The downsizing of Macy’s m is underway.

The struggling department store chain, which in August said it would close about 100 of its 750 or so namesake stores amid declining sales, said on Monday it had sold five of its stores to the second largest U.S. mall developer, General Growth Properties. ggp All but one of those five stores will be closed by spring of next year.

Macy’s, which in August reported a 2% drop in comparable sales, its sixth straight quarter of declines, said the price tag for the stores was $46 million. The retailer will keep operating its store in Tysons Galleria in McLean, Virginia but lease it back from General Growth.

The retailer has been struggling as shoppers flock to discount chains like T.J. Maxx for apparel and as J.C. Penney jcp continues its comeback. Wall Street firm Cowen & Co expects Amazon.com amzn to eclipse Macy’s as the largest U.S. seller of clothes in 2017.

So to fight back, Macy’s is looking to slim down its sprawling fleet of stores to focus on its better stores, including 150 top locations that are getting the bulk of its remodeling and improvement budget. The sale to GGP, whose larger rival Simon Property Group spg , has landed similar deals with various department stores, could also appease an activist shareholder, hedge fund Starboard Value. Starboard, which took a stake in the retailer in July 2015, has pushed for a spinoff of Macy’s best stores into a real estate investment trust, much like Sears and Hudson’s Bay have.

It is only the most recent example of mall developers buying back space from department stores to carve it up and lease it to growing retailers, fetching a higher rent. Simon recently repurposed a Sears location at its King of Prussia mall outside of Philadelphia, creating space for a Dick’s Sporting Goods and a Primark store.

Earlier this year, Macy’s hired an executive vice president for real estate tasked with created joint ventures and other partnerships involving Macy’s flagships and mall-based locations. Macy’s board also appointed a board member who is an expert in real estate trusts in the spring.

Macy’s has said it won’t spin off a real-estate investment trust (REIT), saying it preferred to keep control of its locations, but would seek out partnerships. Last year, Macy’s agreed to sell part of the building that houses its aging downtown Brooklyn store for $170 million but remodel the store.

These are the five stores affected by the GGP deal:

Closing in spring 2017:

  • Carolina Place in Pineville, NC (151,000 square feet; opened in 1993)
  • Oakwood Mall in Eau Claire, WI (104,000 square feet; opened in 1991; 61 associates)
  • Tysons Galleria in McLean, VA (265,000 square feet; opened in 1988; 125 associates)
  • Greenwood Mall in Bowling Green, KY (124,000 square feet; opened in 1980; 61 associates.)
  • Already closed: Quail Springs Mall in Oklahoma City, OK (146,000 square feet; opened in 1986.)