The first step in McDonald's (NYSE:MCD) business turnaround was admitting that it had a problem. Following three straight years of shrinking sales, executives began fiscal 2017 fully aware that they'd made mistakes that cost the fast food titan market share. "As customers' expectations increased," management said in an investor presentation in early March, "McDonald's simply didn't keep pace with them."

"We have to attract more customers, more often," CEO Steve Easterbrook acknowledge as he unveiled a strategic plan that targeted faster growth, increased profitability, and healthy cash returns to shareholders.

McDonald's made impressive strides toward each of these categories in 2017.

Five young friends share a fast food meal.

Image source: Getty Images.

Customers came back

Customer traffic trends have been the best news for the fast food giant's shareholders this year. Guest counts slipped in each of the last three fiscal years, but they began creeping higher early in 2017 before expanding to a market-thumping pace.

Mickey D's handled 0.6% more customers in the first quarter of the year, which helped comparable-store sales gains clock in at 4%. That guest count figure then improved to a 1.8% gain in the second quarter that powered a 6.6% comps increase -- McDonald's best performance in that metric in five years. The momentum carried on into the third quarter, too, as guest counts rose by 2.1% to push comps higher by 6%. Comps are up 5.6% through the first nine months of the year. In comparison, Restaurant Brands' (NYSE:QSR) Burger King has expanded by 2.6% over the same period while Yum Brands' (NYSE:YUM) KFC and Taco Bell franchises grew by 3% and 5%, respectively.

Profits are jumping

Mickey D's profits are rising at a faster pace than sales, with operating income soaring 28% so far this year to reach $7.4 billion. This part of the business is benefiting from an aggressive refranchising initiative that's seeing the company sell thousands of corporate-owned locations to franchisees. Executives are trading lower reported revenue for higher margins in these transactions, since McDonald's gives up the associated restaurant sales. In exchange, they get higher profits delivered through the rent, royalties, and franchise fees that generate most of McDonald's earnings.

MCD Operating Margin (TTM) Chart

MCD Operating Margin (TTM) data by YCharts.

Refranchising has helped push operating margin up to 38% of sales in 2017 from 33% last year. McDonald's is aiming for that figure to reach as high as the mid-40s by 2019 when it has finished lowering its share of restaurants to about 5% of the base, down from 15% last year. Yum Brands and Restaurant Brands can't mimic this strategy since they're already essentially fully franchised.

Cash returns keep flowing

McDonald's aggressive 7% hike to its dividend this year makes sense in the context of these healthy operating and financial results. It's just part of a massive capital return plan, though. The chain has returned $6.3 billion to shareholders through dividends and stock repurchases in 2017 and is targeting an average of $8 billion per year through 2019.

That's down a bit from the $10 billion average that Mickey D's gave investors over the prior three-year period. But shareholders should be happy about the slower direct return pace, given its return to market share growth.

McDonald's isn't shrinking from the leadership position it has recaptured this year. Instead, it is aiming to push the industry forward through expensive initiatives like home delivery and digital ordering and payment. The fast-food chain enters 2018 attacking these huge opportunities from a position of strength that few investors would have predicted a year ago.

Demitrios Kalogeropoulos owns shares of McDonald's. The Motley Fool has no position in any of the stocks mentioned. The Motley Fool has a disclosure policy.