Walmart is closing dozens of stores in the United States as it looks to pare underperforming U.S. stores, expand its promising grocery Neighborhood Markets format, and strengthen its e-commerce capacity.

The discount chain is also closing locations in Brazil and elsewhere in Latin America. A total of 269 stores will be shuttered, accounting for about 1% of its global fleet.

Some 10,000 workers in the U.S. (16,000 total across the world) will be affected, though Wal-Mart Stores wmt , the parent company, said “the hope is that these associates will be placed in nearby [Walmart] locations.”

The world’s largest retailer, whose U.S. comparable sales have been rising for the past five quarters, albeit slowly, has said that as many as one-third of its stores aren’t up to its standards.

The closings are aimed at improving Walmart’s supercenters, which make up the bulk of its fleet, at a time when the retailer is closely integrating its e-commerce and brick-and-mortar locations so that customers can pick up online orders in-store, order items on an app straight from the sales floor, and so Walmart can fill orders more quickly by using store inventory. Such services are aimed at helping Walmart compete with Amazon.com. amzn . The move will also likely allow Walmart to expand its infrastructure for online grocery order pick up at stores to fend off Amazon’s growing delivery business.

 

Wal-Mart Stores CEO Doug McMillon told analysts in October that the company would take a hard look at its store portfolio, hinting that bulkiness could hinder the company’s flexibility. “Being the biggest and being the best are not the same thing. And we have got to be the best,” McMillon said.

Walmart had been experimenting since 2011 with a chain of smaller format stores it called Walmart Express, aimed at getting mid-week business from customers not willing to go to a giant box for a few items. That proved to be a flop, and Walmart is pulling the plug on the format, accounting for 102 of the 154 U.S. closings. (Target tgt is in the process of expanding a similar format, looking to win business from urbanites and office workers.)

Walmart will also shutter 23 Neighborhood Markets (smaller grocery stores), 12 big-box supercenters, seven stores in Puerto Rico, six discount centers, and four Sam’s Clubs.And it will close 115 stores in Latin America, including 60 in Brazil. At the same time, the company plans to open 50 to 60 supercenters and 85 to 95 Neighborhood Markets in the fiscal year starting next month, another effort to improve its fleet.

Walmart is among several other retailers, including Sears, Macy’s, and Target, to recently announce store closings.