swung to a loss and missed Wall Street earnings forecasts after spending millions of dollars during the third quarter to repair its tarnished image following a nasty public feud with its founder.

The company's lackluster performance was not altogether unexpected, but a smaller decline in same-store sales, a key metric for restaurant brands, does a lot for investor confidence. Shares of the company rose more than 3 percent in aftermarket trading Tuesday.

Here's what analysts polled by Refinitiv expect:

Adjusted earnings per share: 20 cents vs 22 cents

Revenue: $364 million vs. $393.7 million

Overall same-store sales: down 9.8 percent vs. down 10.7, according to StreetAccount

Papa John's has been thrown into turmoil since its public feud with former CEO and Chairman John Schnatter broke in July. Sales have tanked, traffic is down and franchisees have been divided, some siding with Schnatter, others with the company and the rest caught between the two.

The company lost $13 million, or 41 cents a share, during the third quarter, compared with a profit of $21.8 million, or 60 cents a share, during the same period last year, the company said after the market closed Tuesday. After adjusting for certain items, the company earned 20 cents a share while analysts expected 22 cents a share, according to average estimates compiled by Refinitiv.

The company excluded $24.8 million in special charges from its adjusted earnings that included $3.6 million in costs to remove Schnatter's image from its marketing materials and $9.9 million in financial assistance to its franchise owners.

The company generated $364 million in revenue, down 15.7 percent from $431.7 million during the same time last year – missing analysts' estimates of $393.7 million.

"During the quarter, we took important actions resulting in improved consumer sentiment and North America comp sales that were slightly ahead of expectations," Steve Ritchie, CEO of Papa John's, said in a statement Tuesday. "While the operating environment remains challenging, these early indicators combined with our strong cash flow give us confidence in the consumer initiatives underway across the Company."

The company's same-store sales were a bright spot in otherwise disappointing earnings. Same-store sales in the quarter fell 9.8 percent across all North American locations, better than the decrease of 10.7 percent analysts had expected, according to StreetAccount.

Company-owned locations saw same-store sales fall more 13.2 percent, steeper than the 11.8 percent analysts had expected according to StreetAccount. Its franchised locations, however, fared better than expectations, posting same-store sales that were down 8.6 percent, better than the 10.5 percent drop that was forecast.

Ritchie said that sales in September showed improvement over July and August, in part because of its new "Voices" ad campaign. It replaced Schnatter's image, which has long been central to the company's marketing and signage, with the other faces from within the company.

Ritchie told analysts the company had a "strong positive response" to the new campaign.

"Employees and franchisees express their appreciation for shedding a light on the real values and people who make up our company," he said on a conference call Tuesday. "Customers also responded positively which shows that the strategy to move in the new more modern and inclusive marketing direction is the right one."

He said YouGov Brand Index shows the consumer sentiment toward the company is shifting "from largely negative to neutral or positive."