Moody’s published a new credit opinion on Wal-Mart Stores Inc. on Friday and while it acknowledged the retail giant’s challenges, the strengths outweigh the weaknesses.

The two main challenges that Wal-Mart faces are spending pressures on the low to middle-income customer population and managing short-term versus long-term expectations.

“We estimate that up to a third of U.S. households continue to live in some form of paycheck-to-paycheck, which means among other things that the end-of-the-paycheck cycle, when consumers search to stretch dollars by shopping for smaller pack sizes, is being magnified,” said Moody’s senior credit officer Charles O’Shea. He also pointed out that consumers aren’t spending their gas pump savings and instead, he thinks, are paying down debt.

Then there are the retailer’s long-term investments that will take time to generate results. O’Shea thinks that investments in employee wages make sense for the longer term, as do investments in expanding Wal-Mart’s multichannel operations. “The company is continuing to generate significant year-over-year growth online of between 15 to 20 percent and we believe Wal-Mart’s online sales level to be in the $15 billion range,” O’Shea said.

Moody’s believes Wal-Mart has many strengths, especially its sheer size and scale. The retailer also has excellent liquidity as it generated cash flow from operations of $29.4 billion in fiscal year 2016, which easily covers capital expenditures of $13.5 billion. Moody’s also likes that Wal-Mart issues no debt in order to complete its share repurchases.

Despite all the headwinds that have faced Wal-Mart, Moody’s points out that the company still continues to be among the best in retail. O’Shea said closing stores was just a thinning of the herd and was a sensible move.

Internationally, there are some risks as that expansion increases. Specifically, managing multiple cultures and disparate local business practices. Additionally, the company remains the subject a Department of Justice investigation over some of its overseas business practices. Wal-Mart’s $135 billion in international revenues seem to outweigh the risks.

Moody’s is retaining its stable outlook and its Aa2 long-term rating. Wal-Mart stock is down 11 percent for the past year, but in the last three months it has seen shares recover by 10 percent and they lately trade at around $69.