BOSTON -- While the Boston Bruins were struggling to score on their way to missing the Stanley Cup Playoffs for the first time in eight seasons, forward Matt Beleskey was enjoying a breakout season with the Anaheim Ducks.

Now the Bruins are hoping Beleskey continues to blossom because their search for offense led them to sign the unrestricted free agent forward to a five-year contract Wednesday that averages $3.8 million per season.

Beleskey, 27, scored an NHL career-best 22 goals during the regular season and eight in the Stanley Cup Playoffs. When free agency began at noon on Wednesday, the 6-foot, 204-pound left wing was one of the most coveted forwards.

"I feel that coming to Boston, there's a lot of great young players, guys who have been around and guys who have won Stanley Cups," Beleskey said. "I think the experience is there and I think the style of play that I play is going to be useful in Boston. I think after being able to score some goals and get that confidence, I'm looking forward to next year. I'm looking forward to doing the same thing."

Bruins general manager Don Sweeney, who was promoted from assistant general manager to replace Peter Chiarelli in May, also acquired forward Jimmy Hayes in a trade with the Florida Panthers in an attempt to improve Boston's 22nd-ranked offense. The Bruins traded forward Reilly Smith and the contract of injured center Marc Savard to the Panthers.

Hayes (6-6, 221), a native of Boston, brings even more size to the Bruins. And like Beleskey, Hayes had a breakout season with 19 goals in 72 games for the Panthers.

"I think both were put into positions to score and play with players that complement their skill sets," Sweeney said. "They're both heavy players in and around the net. They get to the net area, they both shoot the puck very well. They both have some size and strength in the hard areas of the ice and it's things that we identified that we needed to get better at. To have the ability to score goals in the National Hockey League, it's not an easy task, and between them they scored 40 goals.

"So I think that we hope there's even more upside to be played out with these two players and we're hoping obviously, everybody feels, that it's always a projection as to whether or not they're going to continue to move up or they'll flatten out or sometimes they have a bit of a dip. And the rest of the team has to pick up their own socks as a result of that. But I think these two guys, and with the consistency of going to the hard areas of the ice and the size and strength and the shot, I hope they will continue to score goals at the pace they now set themselves on."

The Bruins re-signed restricted free agent center Ryan Spooner to a two-year contract worth an NHL salary-cap charge of $950,000 and unrestricted free agent goaltender Jeremy Smith to a one-year, two-way contract worth $600,000 in the NHL. Spooner had eight goals and 18 points in 29 games for Boston; Smith spent the season with Providence of the American Hockey League but will get a chance to compete for the backup job behind Tuukka Rask.

Acquiring Beleskey and Hayes, Sweeney and his staff showed an ability to adapt quickly. One week ago, the Bruins thought they would be retaining restricted free agent defenseman Dougie Hamilton at a salary-cap charge that would have exceeded what they wound up giving Beleskey. When negotiations with Hamilton didn't work out, the Bruins traded him to the Calgary Flames for three draft picks last Friday, the same day they traded forward Milan Lucic to the Los Angeles Kings.

Although the Bruins didn't receive any immediate help for the NHL roster in either trade, they created some flexibility under the salary cap.

"Well, there was a lot of sordid twists and turns to get to this position. A lot of things had to sort of fall into place," Sweeney said. "You look at the overall direction you want to head, to take the team, and you have to adjust accordingly when certain things are thrown your way. And we had some challenges. Our group responded very well to identify the areas that we wanted to address and look forward. That's what this was all about. It was about gaining some flexibility, continuing to try and improve our team.

"Clearly Dougie Hamilton's an elite player we have a tremendous amount of respect for, and we would've liked to have signed him. When that course of action didn't necessarily take place, we adjusted. And again, our group, the ownership, everybody top to bottom was on board with being able to, as I've stated, find the flexibility and improve our team and also look toward the future."

Entering free agency, Sweeney was comfortable with his depth at center with Patrice Bergeron, David Krejci at the top, and Spooner, Chris Kelly and Joonas Kemppainen among others filling out the list. That depth was part of what attracted Beleskey, who thrived playing with centers Ryan Getzlaf and Ryan Kesler in Anaheim.

"The chance to play with those guys is awesome," Beleskey said of Bergeron and Krejci. "They're two great players, premier centers in the NHL, and they both move the puck extremely well. I'm a guy that, I obviously like to shoot the puck and go to the net. You watch the way that they can create plays, and they're both great in the faceoff circle. It's a great opportunity to have the chance to play with them. And you have young guys like Spooner coming up, who are also extremely creative. So it's just exciting to be able to come to a team like that."

Hayes, 25, played at Boston College for three seasons. He'll have an opportunity to attempt to develop while playing a style that might best suit his size and skills.

"We kind of say it [in Florida], you can't really teach size," Hayes said. "So being big, I have to take advantage of being as big as I am, and I've got to use my reach and use my skill set as well as I can and continue to develop my skill around the net to score a lot of goals. I don't score many goals from outside. I score my goals in tight, so I'm going to have to continue to work on that with my game."

The Bruins have about $9 million in salary-cap space, according to war-on-ice.com. They need to re-sign Hayes and forward Brett Connolly, who are restricted free agents. Sweeney said he's not done looking to improve the Bruins, but the urgency that was eating at him prior to the draft has dissipated.

"I don't know if anybody picks their team per se in July," Sweeney said. "I think you assemble a group of guys you feel confident with, and I think now we're taking a position where any trade that we look to make or any player movement we look to make is one that we absolutely want to and not have to. And we have some flexibility now to look at things completely that way going forward."