Image source: Buffalo Wild Wings.

What's happening: Shares of quick-serve restaurant franchiser Buffalo Wild Wings (BWLD) are soaring some 13% higher on Wednesday afternoon, frantically flapping their  shoulder-mounted wings. The company reported second-quarter results on Tuesday night, missing Wall Street's sales and earnings estimates but outlining how it plans to do better in future quarters.

Why it's happening: In the second quarter, B-Dubs' sales rose 16.5% year-over-year to land at $426 million. Analysts had been hoping for $430 million. On the bottom line, earnings declined 10% to $1.12 per share, while the Street was looking for $1.26 per share. Buffalo Wild has now missed earnings estimates in three consecutive quarters, by increasingly large margins.

You'd expect shares to fall on a large earnings miss, but Buffalo Wild Wings did the exact opposite. In part, the counter-intuitive surge rests on 4.2% higher same-store sales versus an analyst consensus of 3.7%, but the company is also setting itself up for even stronger customer loyalty.

Although we don't believe in timing the market or panicking over market movements, we do like to keep an eye on big changes -- just in case they're material to our investing thesis.

The weak earnings resulted from rising food and labor costs. Chicken wings now cost 26% more per pound, year-over-year, and the company is providing both higher wages and stronger benefits packages to its workers.

But the company isn't backing away from these higher costs. Instead, management takes pride in offering a premium dining experience and will continue to pay competitive wages and strong benefits to support this crucial selling point.

In an earnings call with analysts, Buffalo Wild CEO Sally Smith said that the company bought out 64 franchise locations during the second quarter and plans to do even more. In July, for example, the company agreed to take home another 41 locations in Texas, Hawaii, and New Mexico. This exposes the company to more labor costs, but also brings home a greater portion of these restaurants' profits.

"In the near term, we're working on labor efficiencies but keeping our primary focus on delivering a great guest experience," Smith said.

The company is passing the increased costs on to the consumer. Menu prices have increased 3.8% over the last four quarters, and another round of pricing tweaks is coming up. Alcohol prices will be adjusted in August, and boneless wings will follow suit later in the fall. A points-based loyalty program is currently rolling out across the restaurant grid, supported by a unified point-of-sale network.