SANTA CLARA, Calif. (AP) — Most executives preach the importance of building through the draft. Splashy free agent signings each March generate lots of headlines.

When it came to building the San Francisco 49ers into a Super Bowl team, coach Kyle Shanahan and general manager John Lynch used a tactic that’s not nearly as common in the NFL with a series a trades that have put key starters in place.

“John and his staff have been unbelievable,” Shanahan said. “When we came here, we knew we had to go get some. There were a lot here to start with that have worked out very well, but we also knew we had a lot of hard work in front of us. John and his staff have presented all this stuff and got us a ton of guys, and it’s been great because even the big key ones that everyone knows about have made a difference.”

The biggest one of those of course came midway through the 2017 season when the team was eight games into an 0-9 start when New England coach Bill Belichick called to offer quarterback Jimmy Garoppolo for a second-round pick.

The Niners leaped at the chance and got the most important piece of the rebuilding process. But that wasn’t the only key trade.

Just before the start of that season, San Francisco sent a fifth-round pick to Detroit for former first-round guard Laken Tomlinson, who almost immediately stepped in as a starter who has been a key part of the line ever since.

Two more big trades came this past year starting in March when the 49ers dealt a 2020 second-round pick to Kansas City for pass rusher Dee Ford.

Ford has teamed with rookie Nick Bosa as a formidable edge-rushing duo that has transformed a defense that lacked playmakers into one of the most feared units in the league.

“His take off, his get off is one of a kind,” defensive tackle DeForest Buckner said about Ford. “Probably the best first step I’ve ever seen. Just to see him, it’s like a track meet. You hear the gun and he’s taking off. It’s pretty impressive to see.”

Then perhaps the final piece was put into place during the season when San Francisco dealt third and fourth-round picks to Denver for receiver Emmanuel Sanders and a fifth-round pick.

That filled the void of a No. 1 receiver that the Niners lacked, allowing the offense to step up its production in the second half of the season when the defense was hampered by injuries.

“It gave us a big pick-up when we needed it,” Shanahan said. “Emmanuel came in and allowed our other receivers to grow. I don’t know how ready all those other guys were quite yet and Emmanuel came in and took a lot of pressure off the guys right away.”

Perhaps the second-biggest move to the one that brought Garoppolo to town was the season-ending knee injury to Garoppolo in 2018. That led to a 4-12 finish that gave the Niners the No. 2 pick in the draft and the chance to draft Bosa.

“Things have a way of working out,” Garoppolo said. “I always told myself it was a blessing in disguise, the ACL and everything, and yeah, we got Bosa out of it. That’s a pretty good trade-off, I guess. Things have a way of working out, I guess. This ride is crazy. You’ve just got to roll with the punches.”

Bosa was the fourth defensive lineman taken by San Francisco in the past five drafts, joining Buckner, Arik Armstead and Solomon Thomas.

Using high picks on the line has been a philosophy in San Francisco that predates the Shanahan-Lynch regime with left tackle Joe Staley being drafted 28th overall in 2007. He teams with 2018 first-round right tackle Mike McGlinchey to anchor the line.

The skilled position players on offense have been found with lower-value picks. The Niners haven’t had a quarterback, running back, tight end or receiver who was drafted in the first round play a single snap in three years under Shanahan.

In fact, the Niners have gotten more offensive production out of undrafted players than first-rounders with 24 TDs this season from players who weren’t drafted, 11 more than any other team this season.

“It’s just one of those things that shows you how hungry guys are,” running back Raheem Mostert said. “It doesn’t necessarily mean guys have to be first- or second-rounders in order to get the ball. All you have to do is produce and that’s something that guys who have been in the lower tier of the draft or undrafted have been capable of doing.”

Mostert led the undrafted group with 10 touchdowns after arriving late in 2016 after he was cut by his sixth team. He’s the only skill position player on the roster who predated Shanahan’s arrival.

The Niners have also made key additions in the later rounds of the draft with All-Pro tight end George Kittle coming as a fifth-rounder in 2017 and middle linebacker and defensive leader Fred Warner arriving the following year as a third-rounder.

Finally, free agency has played a big role with additions such as cornerback Richard Sherman and linebacker Kwon Alexander the past two years.