PHILADELPHIA -- The dots are a little more connected than they were back in March.

The Philadelphia Eagles traded running back LeSean McCoy to the Buffalo Bills on March 4. A week later, the Eagles sent quarterback Nick Foles to St. Louis in exchange for Sam Bradford.

The two trades were big surprises at the time. Nine months later, they seem part of the same puzzle.

Eagles head coach Chip Kelly said the McCoy deal was initiated because of the running back’s contract. McCoy was due to count $11.95 million against the Eagles’ 2015 salary cap.

With the Eagles and Rams discussing the swap of quarterbacks, Kelly knew he was about to take on Bradford’s $13 million contract.

“We had to free up money to get Sam,” Kelly said Thursday. “It was a tough decision.”

The Eagles got Kiko Alonso back in the McCoy deal. Alonso was going into his third season on his rookie contract. He counts $795,000 against the Eagles’ salary cap this year -- more than $11 million less than McCoy.

“Those decisions are made by money,” Kelly said.

Kelly’s next priority was replacing McCoy in the backfield. He signed DeMarco Murray and Ryan Mathews as free agents. Instead of one back, McCoy, making $11.95 million, the Eagles had three backs: Murray, Mathews and Darren Sproles.

“We have three running backs here whose salary cap hit is $11.1 (million),” Kelly said. “We had one guy who was going to (count) $11.9.”

Meanwhile, Kelly was determined to shift some salary cap money from the offense to the defensive side of the ball. He released cornerback Cary Williams and linebacker Trent Cole. That helped shave about $15 million from the 2015 salary cap.

Those moves gave the Eagles room to sign cornerback Byron Maxwell to a six-year, $63 million contract. Maxwell counts $8.7 million against this year’s salary cap.

All of this is clouded by the structure of NFL contracts, which often include larger, non-guaranteed salaries in the later years. McCoy’s 2015 salary was an example of that.

“One of the things we had, we had players that were older, at the end of their contracts, getting paid big money,” Kelly said. “That’s one of the things in this league. A guy signs a four-year, $25 million deal, but it’s two years at $16 (million) guaranteed. The rest of it isn’t and the back-end years are really high. So you have to make decisions.”

With McCoy, Kelly said, it was a tough decision. But it helped set the Eagles’ other moves into motion.