Lowe's shutting 20 stores in the US and 31 in Canada

New York (CNN Business) In another sign of the times for retail, Lowe’s is closing 47 North American stores.

Lowe’s said Monday that those locations are underperforming and the decision will help the hardware chain focus on its most profitable stores.

“The store closures are a necessary step in our strategic reassessment as we focus on building a stronger business,” said CEO Marvin Ellison, in a statement.

Retail stores are struggling to adjust to the rapid rise of online shopping, particularly from Amazon (AMZN). Many successful retailers with big stores have adjusted their business strategies to make better use of their physical spaces. Others, including Sears, Kmart and Toys “R” Us, failed.

Lowe’s and its rival Home Depot have proven to be largely Amazon-proof, because Amazon does not sell lumber or other heavy, bulky home improvement products.

But Lowe’s is struggling to keep up with Home Depot. Last year, Home Depot’s revenue hit more than $100 billion, while Lowe’s sales were below $70 billion. Lowe’s stock price has also lagged behind its rival, leading to pressure from activist investors.

Earlier this year, Lowe’s gave the reins to a home improvement veteran to turn around the company. Ellison was a top executive Home Depot for more than a decade, and most recently served as JCPenney’s (JCP) CEO.

Ellison has already made some big strategic decisions, including closing all of its Orchard Supply Hardware stores and slashing inventory at its Lowe’s stores.

He believes targeting professional home builders and construction companies with higher-quality tools and equipment, additional discounts, and better customer service will improve Lowe’s. Sales to home building pros make up around 45% of Home Depot’s sales, but only around 30% of Lowe’s sales, according to analysts at Wedbush Securities.

Lowe’s (LOW) will shut down 20 stores in the United States and 27 in Canada. The company said that a “majority” of the shuttered stores are within 10 miles of another Lowe’s location. Additionally, four offices and specialty facilities in Canada will also be closed.

The stores will be closed before Feb. 1, 2019. The company will try to find jobs at nearby stores for its employees affected by the closings.