Since plummeting from the pinnacle of men’s tennis after the 2016 season, Novak Djokovic has revived and won the past two Grand Slam titles, at Wimbledon and the U.S. Open. He’s the No. 1 player in the world and is in the quarterfinals of the Australian Open, where he could set the tournament’s all-time record for men’s titles with the seventh of his career.

So, how is Djokovic, at 31 years old, doing this after struggling for so long? He had minor surgery on his right elbow to address an injury that had been bothering him for two seasons. But he also made a bold decision that may have saved his career: He ditched Andre Agassi and Radek Stepanek as coaches, trashed his new serve motion and went back to his former technique.

Data from the ATP Tour shows how much Djokovic improved last season after he reunited with his longtime coach and serve adviser, Marian Vajda, just before the clay court season began. From January until the start of Wimbledon, Djokovic won just 83 percent of his service games. On first serves, he won 71 percent of points played, just as he did in all of 2010 — arguably the worst serving season of his full-fledged career. (That year, he hit almost as many double faults as aces.) He also saved just 61 percent of break points against him, a level that, if it had persisted for the whole year, would have been his worst performance since 2005, when he played 22 ATP matches and was 11-11 for the year.

Once he went back to his former serve motion last year, Djokovic transformed. From Wimbledon through the end of the season, Djokovic won 90 percent of his service games. He won 77 percent of first serve points and saved 68 percent of break points against him — the same share as in 2015, his most dominant season. (He played in the final of all four Grand Slam tournaments and won three of them. His season record: 82-6.)

After Djokovic missed the second half of 2017, he tried to mend his balky elbow — and put less pressure on it — with a new serve. Instead of raising his racket after releasing the ball, Djokovic moved both arms together, which put his racket up sooner and, he hoped, would decrease the strain on his elbow. Djokovic said he spent hours with Agassi and Stepanek analyzing his serve to discover a way to reduce his pain and be just as effective.

It didn’t work. Even after his successful elbow operation, Djokovic’s new serve continued to struggle. In the early part of the season, he looked like a shadow of his former self. At Indian Wells, he lost to Taro Daniel, ranked No. 109, in his first match. In Miami, he lost to Benoit Paire, ranked No. 47. His record through March stood at just three wins and three losses.

This wasn’t the first time Djokovic had set out to overhaul his serve. In 2009, he hired Todd Martin, a two-time Grand Slam finalist with a deadly serve, to work on his motion. But instead of helping Djokovic, the changes led to a weaker serve. Djokovic split with Martin in April 2010. Djokovic then went back to Vajda, and he improved his serve as that season progressed. He reached the U.S. Open final by beating Roger Federer in five sets — saving two match points — and then lost the final in four sets to Rafael Nadal. After winning two matches to help Serbia win the Davis Cup at the end of the year, Djokovic was a changed man. In 2011, he won his first 41 matches and took home three major titles.

At this year’s Australian Open, Djokovic’s serve has been broken eight times in 21 chances. That’s 62 percent of break points saved, nowhere near his best. Against Daniil Medvedev, a 22-year-old talent, Djokovic at times looked tired with a strained back, though he said that was “nothing major.” So he could be vulnerable. Then again, Kei Nishikori, Djokovic’s quarterfinal opponent, looks exhausted after going five sets in three of his four matches. If Djokovic can beat Nishikori, he’ll face either Milos Raonic or Lucas Pouille, neither of whom has ever won a major title. Djokovic is 15-2 against Nishikori and 9-0 against Raonic. He has yet to play Pouille.

Djokovic has 14 major titles and could challenge Nadal’s 17 and Federer’s all-time men’s record of 20. But it won’t be easy, no matter how well Djokovic serves. The young talent in tennis is, finally, on the rise and may be ready to take over from the old guard. No matter what, though, Djokovic must stick to an essential rule: Don’t ever — EVER! — replace your serve again.