McDonald's (MCD -0.46%) is reaping the benefits of its three years of turnaround efforts. The fast-food chain, which boasts more than 36,000 global locations, saw its stock rise about 40% in 2017 as it experienced increased customer traffic after some updates to its menu and restaurants. 

On Jan. 30, McDonald's released its fourth-quarter and full-year results. Customer traffic grew by 1.9% year over year for the full 2017 year, which marked the first increase on that metric in five years. 

To figure out why McDonald's stock shot up that much in 2017, we need to take a closer look at the company's overall turnaround plans that seem to be moving faster than expected. 

A McDonald's in Denton, Tex., is shown with an empty parking lot

McDonald's same-store sales are on an encouraging upturn. Image source: McDonald's Corporation.

Same-store sales got a lot juicier

McDonald's same-store sales figures from 2017 were the proof it needed to show investors that its turnaround efforts are working. 

The first quarter brought a 4% increase in global comparable sales for McDonald's. In an April 25 letter to investors, the company's CEO Steve Easterbrook said the team was working to keep existing customers and win back lost customers by focusing on making the in-store experience more efficient and enjoyable with things like menu and technology updates.

"Our efforts to build a better McDonald's are yielding meaningful results with continued positive momentum and a strong start to 2017 that includes positive comparable sales across all segments, higher global guest counts and enhanced profitability," Easterbrook said at the time.

For the second quarter, McDonald's reported a global same-store sales increase of 6.6%. This was significant because it was the company's strongest global comparable sales results in over five years. 

Although growth slowed a bit compared to the second quarter, the second half of 2017 was also encouraging -- global same-store sales increased 6% in the third quarter and 5.5% in the fourth quarter -- as the company marked its 10th consecutive quarter of global same-stores growth.

In its full-year report, McDonald's said 2017 ended up being its best full-year global comparable-store sales performance in six years with an increase of 5.3%. "Our results demonstrate we successfully completed the transition from turnaround to growth," Easterbrook said on the fourth-quarter earnings call. 

Updates to stores helped increase foot traffic

The company spent 2017 working to improve the in-store experience for customers. That meant serving food that was fresher and hotter, as well as offering friendlier service, Easterbrook said.

Restaurants also benefited from menu updates, including its McPick 2 promotion that offered two items for $5, as well as the $1 offer for any sized soft drink, and the addition of new food choices like Buttermilk Crispy Tenders and its sriracha-and-kale burger. 

In January 2018, McDonald's went a step further with its promotions by offering $1, $2, and $3 menus to replace the McPick 2 option. While the new deals weren't included in the 2017 financial year, they are evidence that McDonald's is continuing to work on appealing to its more value-conscience customers who were previously turned off by the restaurant discontinuing its famous Dollar Menu. 

McDonald's is also excited about technology updates to its stores as part of its "Experience of the Future," or EOTF, initiatives, which most notably includes the adoption of self-ordering kiosks. The company ended 2017 with 3,000 EOTF restaurants in the U.S., well above its forecast for 2,500 EOTF conversions. 

In the latest earnings call, McDonald's said it will bring EOTF to an additional 4,000 U.S. restaurants in 2018, which will result in about half of U.S. establishments being fitted with the technology by this time next year. The company hopes these updates will continue to provide more efficient visits for customers. 

Crushing its refranchising plan

McDonald's ended 2017 with franchise restaurants representing 92% of its total base, up from 81% just three years ago and moving closer to the company's long-term goal of having 95% of restaurants owned by franchisees. 

In total, McDonald's said it renovated 4,000 restaurants in 2017, which was ahead of target. But this is also why full-year revenue for the company dropped about 7% to $22.8 billion. 

The company has been up front about expected revenue drops as it completes its refranchising plan that should free up capital to return to shareholders. When the company refranchises restaurants to independent owners, it transfers labor costs and operating expenses to them, too. This goes back to McDonald's being mainly a real estate company. 

Looking ahead to 2018, the company warned in its latest earnings call that results will be "choppy" as it continues refranchising several markets. But if you take something away from 2017, it's that McDonald's turnaround efforts are already showing positive signs. McDonald's is thinking long term with a plan that should be worth it for both shareholders and customers in the end.