Last Friday, J.C. Penney (JCPN.Q) reported a solid comp sales increase but sharp erosion in its profitability for the third quarter. The results weren't good, but investors had been expecting an even worse performance after J.C. Penney issued a dreadful guidance update in late October.

As a result, J.C. Penney shares surged 15% on Friday. However, the company will need to get its earnings moving in the right direction again for the stock to continue its comeback. During J.C. Penney's recent earnings call, management pointed to a number of reasons for optimism. Here are five key highlights.

Multiple causes of margin weakness

Cost of goods sold for the third quarter was 66% of net sales, an increase of 320 basis points compared to the same period last year. Our decision to liquidate slow-moving inventory during the quarter accounted for slightly over 100 basis points of the increase.
-- J.C. Penney CFO Jeffrey Davis

In its late October guidance update, J.C. Penney blamed its gross margin deterioration primarily on a decision to move faster in clearing out slow-moving inventory. This was part of a broader shift toward more casual styles in the women's-apparel business.

The exterior of a J.C. Penney store

J.C. Penney has been carrying too much traditional workwear. Image source: J.C. Penney.

In reality, this clearance activity accounted for only about a third of the company's gross-margin decline. Rapid sales growth in major appliances and e-commerce, two lower-margin areas, also had a major impact. Another headwind was higher shrink -- i.e., reserves for stolen merchandise.

Nevertheless, management projects that gross margin will increase slightly year over year in the fourth quarter. The growth rate of J.C. Penney's appliance business is expected to slow from last quarter's triple-digit pace. An improved inventory position and refinements to the company's promotional strategy should also help reduce markdowns.

The key women's business is finally improving

Women's apparel delivered a positive comp for the month of October even when you remove the benefits of the accelerated clearance sales. Although we're not declaring victory, this is the first positive comp for a month in this category in 14 months.
-- J.C. Penney CEO Marvin Ellison

One of the best pieces of news from J.C. Penney's earnings report was that its women's-apparel business returned to growth in October for the first time in more than a year. It did so even without the benefit of clearance activity. Women's apparel is J.C. Penney's biggest merchandise category, accounting for 24% of its 2016 revenue, so it's hard to overcome falling sales in that department.

The strong October performance indicates that customers are responding well to J.C. Penney's new merchandise assortment in women's apparel. That bodes well for the fourth quarter and fiscal 2018.

Strong growth in home categories continues

Appliance sales both in-store and online continue to drive significant comp sales growth and improve productivity in our home store. ... In addition to appliances, we saw excellent results in our newly opened mattress showrooms and our assortment of smart-home products.
-- Ellison

While women's apparel has been a source of trouble for J.C. Penney lately, the home department has been its biggest growth driver. Last quarter, the appliance business continued to gain momentum. Total sales surged 128% year over year, while comp sales for that category rose 30% in stores that also had appliance showrooms a year earlier.

A J.C. Penney appliance showroom

J.C. Penney's appliance showrooms have been a huge success. Image source: J.C. Penney.

The move into appliances is J.C. Penney's highest-profile initiative in the home department. However, other changes -- like offering an expanded mattress assortment in more than 500 stores -- are succeeding as well. The resurgence of its home department will help J.C. Penney diversify its business and reduce its reliance on apparel sales.

Taking a more rigorous approach to pricing

[J]ust a little over a year ago, J.C. Penney still had a very decentralized pricing strategy. Said another way, our pricing was really driven by the individual merchants and individual buying teams, and there was really no overarching pricing strategy. So we centralized pricing.
-- Ellison

Some of the biggest changes at J.C. Penney are happening behind the scenes. The company recently revamped its organizational structure and is working to become more "scientific" about pricing in particular. Instead of relying on individual merchants to set prices based on their intuition and experience, J.C. Penney is using data analytics to improve decision-making.

This could help the company on two fronts. First, a coherent pricing strategy could drive more traffic to its stores. Second, the new approach to pricing is uncovering areas where J.C. Penney can safely raise prices without losing customers. Over time, this should alleviate the pressure on its gross margin.

The balance sheet will continue to improve

Given the actions taken in the second quarter this year to reduce 2018 and 2019 maturities to levels below $200 million each, we have manageable debt maturities within our projected free cash flow over the near term.
-- Davis

J.C. Penney has posted mediocre results over the past year and a half, as management has made some tough decisions with an eye toward improving its long-term competitiveness. However, that won't mean much if the company doesn't survive that long.

The company does continue to make steady progress in cleaning up its balance sheet. Earlier this year, it completed a tender offer for $300 million of its outstanding debt, reducing its debt maturities for the next two years. In February, the company plans to pay down $190 million of maturing debt using the cash flow it will generate during the holiday season.

Management is also confident about repaying $175 million that's due in late 2019. Asset sales, better working capital management, and stronger underlying profitability should all help the company produce enough cash to buy time for a turnaround.