The Cavs were somersaulting out of control before Thursday’s NBA trade deadline. Suddenly, LeBron James has a much better team around him. (Tony Dejak/AP)

When the Cleveland Cavaliers began their NBA trade deadline day with a stunning deal sending Isaiah Thomas to the Los Angeles Lakers, the reaction from around the league wasn’t exactly positive.

“Cleveland helped the Lakers get LeBron [James],” one executive texted.

Another was more blunt: “What the f—?”

The Cavaliers entered Thursday knowing they needed to make at least one deal before the deadline passed. After a month of losing and infighting, blowout losses and damaging stories about the state of the locker room and the relationship between superstar LeBron James and owner Dan Gilbert, it seemed they were in need of a shake-up if they were to reach their fourth straight NBA Finals.

Still, few expected this much of a shake-up, and for it to begin with a trade with the Lakers, a move that could help James and another star sign with Los Angeles this summer. But after the initial confusion over the Cavs shipping out Thomas for two young players, Cleveland kept dealing — and the picture grew clearer.

Over the course of an hour, the Cavs brought in Rodney Hood from the Utah Jazz and George Hill from the Sacramento Kings to go with the acquisitions of Jordan Clarkson and Larry Nance Jr. from the Lakers. In the deals, they shed Thomas, Channing Frye, Jae Crowder, Derrick Rose, Iman Shumpert, Dwyane Wade and their 2018 first-round pick.

The result of all that dealing? The Cavaliers could again be the favorites to emerge out of the Eastern Conference after remaking their roster with a desperately needed blend of youth, athleticism, shooting and defense.

Outside of Cleveland, Thursday’s deadline was a dud. A few deals were made, mostly spare parts exchanged for second-round picks or bad teams taking fliers on former lottery picks (Emmanuel Mudiay to the New York Knicks and Elfrid Payton to the Phoenix Suns). Otherwise, it was much ado about nothing.

Two hotly discussed players, DeAndre Jordan and Avery Bradley, remained with the Los Angeles Clippers, who will try to make the playoffs after agreeing to a contract extension with Lou Williams on Wednesday. Others such as Tyreke Evans and Marco Belinelli — players widely expected to move — remained with the Memphis Grizzlies and Atlanta Hawks, respectively. Across the league, teams decided it was worth hanging onto such players instead of getting a minor asset or taking on future money.

That wasn’t the case in Cleveland. The Cavaliers, knowing they needed to do something to help convince James to stay, swung for the fences.

At first, there was confusion around the league about what Cleveland was trying to accomplish. By taking on Clarkson and Nance, the Cavaliers gave the Lakers the ability to approach $70 million in cap room this summer (assuming they stretch the remaining $36 million on Luol Deng’s contract and don’t keep Julius Randle). That will have Los Angeles easily within striking distance of being able to offer max contracts to both James and Oklahoma City Thunder star Paul George. It’s a scenario the Lakers have been gaming out for more than a year.

But the Cavaliers clearly decided they weren’t going to waste what could be James’s final season in Cleveland. By making deals for young players with years remaining on their contracts, they also are able to provide James with pieces that can help if he chooses to re-sign.

On a team with an aging roster and little athleticism, adding a trio of 25-year-olds (Clarkson, Nance and Hood) will feel like a breath of fresh air.

Clarkson is averaging 14.5 points and three assists, and while he’s only a career 33 percent three-point shooter, the combo guard gives Cleveland a dimension in its backcourt it previously didn’t have.

Nance is a strong defensive big man who has the ability to play above the rim and may be a better starting option than Tristan Thompson. Either way, the Cavaliers got a much-needed boost to what has been one of the worst defenses in the league this season.

Hood had fallen out of favor in Utah, but he is precisely the kind of player that has always thrived playing alongside James. The swingman was averaging 16.8 points for the Jazz while shooting 38.9 percent from three-point range — a number that could easily go up playing for the Cavaliers. Hood has had trouble staying healthy, but the fact that his minutes can be reduced with Cleveland should help him avoid injury. In a summer where there will be little to no free agent money available, the Cavaliers will have a good chance of keeping Hood, a restricted free agent, on a team-friendly deal.

Hill, 31, has looked uninterested at times in Sacramento, but he’s still shooting 45 percent from three-point range this season, and with his length and ability to play both on and off the ball and guard multiple positions, he will — like Nance — help Cleveland’s defense.

While shaking things up in Cleveland was necessary, it was just as important that part of that shake-up included getting rid of Thomas. In the month since Thomas returned to the court after months of rehabbing his injured hip, the Cavaliers have fallen off a cliff, and the former all-star point guard has been a big reason.

Some of that isn’t his fault — the Cavaliers, after all, are the ones who traded for him as part of the package for Kyrie Irving, and they knew he was damaged goods upon arrival — but that doesn’t change the fact that Thomas is shooting 36.1 percent from the floor and 25.3 percent from three-point range on a high volume of attempts while still providing little in the way of defense.

He had also become an issue in the locker room. Thomas, who has never been shy about speaking his mind, had taken to blasting the Cavaliers after just about every loss, and had made repeated pointed comments recently about Coach Tyronn Lue.

“Collectively, as a group, we got to do better,” Thomas told reporters after a loss Tuesday night. “It’s not just about me. We got to do better. We got to adjust throughout the game. They made adjustments and it worked, and we just kept getting hit with the same thing and we made no adjustments. And that’s been one of our biggest problems all year, is adjusting.

“Teams are not just going to allow us to continue to score and continue to do things at a high level. They’re going to make adjustments, and we have to do the same thing too, and we’re not that good at that right now.”

If there was anything that summed up where Thomas was with the Cavaliers, it was this image of him after James hit a game-winner Wednesday night to beat the Minnesota Timberwolves in overtime:

Moving on from both Crowder and Rose makes sense for similar reasons. Rose has been a mess all season, spending significant time injured with a sprained ankle and even leaving the team for a period. He never seemed like a good fit with the Cavaliers and the way they play. Crowder, meanwhile, could never seem to get his season on track after being part of the Irving trade and the death of his mother last summer.

It was a different story with Wade. The Cavaliers approached the future Hall of Famer and asked him — with an influx of younger wing players coming in — if he’d like to return to Miami, where he spent the first 13 seasons of his career and where his children are still enrolled in school. Wade said he would, and the two teams quickly agreed to a deal to send him to the Heat.

The Cavaliers desperately needed to change the tenor around the franchise. They did so Thursday, and in dramatic fashion. Four players in, six players and a first-round pick out. They’ll have two months to prepare for what they will hope will be another long playoff run, and possibly a fourth straight NBA Finals appearance. Maybe it will be enough to convince James to remain in Cleveland for at least another year.

Read more on the NBA:

Cavaliers trade basically everyone, Internet goes berserk

Wizards trade injured player Sheldon Mac to open roster spot

How NBA teams’ reckless spending on 2016 free agents is crippling the market today

Kristaps Porzingis’s torn ACL is a cruel blow to a franchise that’s all too used to them

The Wizards are winning without John Wall, but it’s crazy to think they’re better off without him