Wal-Mart (NYSE:WMT) made a big announcement yesterday.

The retail giant said it would raise its minimum wage to $11 an hour and pay employees bonuses up to $1,000 following the passage of the tax reform bill. However, while Republicans and others were celebrating the news, a separate story broke. Wal-Mart had slapped "closed" notices on dozens of Sam's Clubs stores across the country, surprising employees who had shown up for work that morning.

While it may have been a public-relations gaffe to mix both a good-news and bad-news story, it's understandable why Wal-Mart is trimming its Sam's Club fleet. Later in the day, Wal-Mart issued a release saying it would close 63 Sam's Clubs and convert up to a dozen of them into e-commerce fulfillment centers. It would also take $0.14-per-share charge for the move. The company said it took the action after a "thorough performance review," adding, "Transforming our business means managing our real estate portfolio, and Wal-Mart needs a strong fleet of Sam's Clubs that are fit for the future."

Chronic underperformance

Sam's Club, a buy-in-bulk membership chain, has always played second fiddle to Wal-Mart's namesake stores. Part of the problem has been that Sam's Club has historically been too similar to Walmart stores, carrying basically the same merchandise and often being located next to a Walmart. About 200 of the 660 U.S. Sam's Clubs share a parking lot with a Walmart. That means Walmart is often the biggest competitor to Sam's.

That may be one reason Sam's Club has also chronically underperformed the leader in warehouse retail, Costco Wholesale (NASDAQ:COST). While the two companies have about the same number of stores, Costco's revenue is twice that of Sam's. Costco has benefited from targeting wealthier enclaves along the coasts, as opposed to Sam's Club, which has followed the geographic footprint of Walmart stores, favoring the rural South. However, since membership clubs require an upfront payment, they tend to attract a wealthier clientele than a typical Walmart store would, which may partly explain why Sam's has lagged Costco.

Transitioning to e-commerce

For years, Sam's Club posted flat or declining comparable sales, though in recent quarters those numbers have improved because of wage increases and investments in stores, tracking with a strong recovery Wal-Mart's own namesake stores. However, the retailer has been sharpening its focus on e-commerce for several years now. In 2016, it acquired Jet.com for $3.3 billion, which was followed by smaller e-commerce acquisitions including Bonobos, Modcloth, and Moosejaw.

The company has also been rationalizing its store base, dramatically cutting down on new store openings domestically, planning this year to open fewer than 15 Supercenters, 10 Neighborhood Markets, and no Sam's Clubs , which is a sharp contrast from its land grab strategy a decade ago. Two years ago, Wal-Mart shuttered 269 stores globally, including all 102 of its Express stores, and since then the company has closed more stores in the U.S. than it has opened.

The focus now is on e-commerce rather than new stores, which explains the company's push to add 1,000 more online grocery pickup locations this year, in addition to the 1,000 it's already opened. But its decision to convert as many as a dozen of the closing Sam's Clubs into e-commerce warehouses is just as noteworthy. Wal-Mart, with the help of Jet.com founder Marc Lore, is starting to realize that its real estate has just as much value serving online customers as ones in-store. Converting those locations to fulfillment centers will help the company accelerate deliveries and expand its available inventory, both for Wal-Mart and subsidiary brands like Jet.

Like other retailers, Wal-Mart has come to the conclusion that rather than stores, convenience will be the key driver for future sales. For some customers, convenience may mean coming into a store when they wish. For others, it could be picking up groceries they ordered online on their way home, and still others will prefer to have everything delivered.

Wal-Mart has already blanketed the country with 5,000 stores. In today's environment, having another 660 Sam's Clubs just doesn't make sense, especially since many of them are next to Wal-Mart stores. Using that space for e-commerce and investing in omnichannel sales is a better way to build for the future.