NEW YORK (AP) — Macy’s said Tuesday it is closing 125 of its least productive stores and cutting 2,000 corporate jobs as the struggling department store tries to reinvent itself in the age of online shopping.

The store closures represent about one fifth of Macy’s current total. They include about 30 that are in the process of closing and account for $1.4 billion in annual sales.

Macy’s didn’t specify how many jobs would be lost at the shuttered stores.

The corporate jobs will be shed as Macy’s closes its offices in Cincinnati and San Francisco, leaving New York as its sole corporate headquarters.

Macy’s is also testing a new smaller-store format that’s located at a strip center, instead of a mall. The store will feature a mixture of Macy’s merchandise and local goods as well as food and beverage options. It will open its first so-called Market by Macy’s in Dallas on Thursday.

Macy’s, like its peers Nordstrom and J.C. Penney, is dealing with stiffer competition and shoppers’ changing behavior. Department stores are seeing their customers increasingly head to off-price stores like T.J. Maxx for fat discounts on name brands. They’re also renting and buying second-hand goods online.

READ MORE: U.S. retail sales dip 0.3 percent in September

Macy’s has pursued a number of strategies as a way to lure people back. Those include recently teaming up with resale site ThredUp. The company’s Bloomingdale’s division launched a rental service last year. And it’s been expanding its off-price concept called Backstage in many of its stores.

It has also been upgrading the look of its top 150 stores in healthy malls.

Still, that hasn’t been enough.

Macy’s reported a steeper-than-expected 3.5% drop in sales at stores opened at least a year in its fiscal third quarter, which ended in Nov. 2. That marked Macy’s first quarterly comparable store sales decline in almost two years.

Its business during November and December showed some improvement — same store sales fell 0.6%. But analysts say that the department store is losing market share. The company is set to report final fourth-quarter results later this month.

“We will focus our resources on the healthy parts of our business, directly address the unhealthy parts of the business and explore new revenue streams,” said Jeff Gennette. who took the reins as CEO in early 2017.

The moves announced Tuesday come ahead of Macy’s annual investor meeting where Gennette is expected to unveil a three-year reinvention plan.

Shares in Macy’s Inc. slipped 8 cents to $16.55 in after-hours trading following the company’s announcement. Over the past year, Macy’s shares have declined nearly 36%.