After several years of comparable-store sales declines and falling earnings, Macy's (NYSE:M)started to get back on track in 2018. For most of the year, the company posted solid comp sales growth and expanded its profit margin. Despite a disappointing performance during the holiday season, Macy's has clearly made progress toward a turnaround over the past year.

Nevertheless, it plans to continue closing stores in 2019, recently confirming eight store closures to Business Insider. Let's look at why the department store giant still seeks to shrink its footprint -- and why it may continue to close a handful of stores each year for the foreseeable future.

Two main kinds of stores

Back in August 2016, Macy's announced plans to close about 100 of its 728 Macy's stores over the next several years. In the words of then-president Jeff Gennette (now the company's CEO):

Nearly all of the stores to be closed are cash flow positive today, but their volume and profitability in most cases have been declining steadily in recent years. We recognize that these locations do not yield an adequate return on investment and often do not represent a customer shopping experience that reflects our aspirations for the Macy's brand. We decided to close a larger number of stores proactively so we can invest in a winning customer experience in our most productive and highest-potential locations, as well as invest in growth sooner and more aggressively in digital and mobile.

By early 2018, Macy's had already completed more than 80 of its 100 planned store closures. Generally speaking, the stores set to close this year fall into two categories: underperforming locations and stores with other Macy's locations nearby.

There's some overlap between the two categories, but the first group would seem to include the Macy's locations in Casper, Wyoming; Redmond, Washington; Sunnyvale, California; and Swansea, Massachusetts. Stores in Indianapolis; Los Angeles; McLean, Virginia; and Nanuet, New York, fall into the second category. Each one has another Macy's within five miles.

Macy's Traffic passes on 34th street in fron of the Macy's store at Manhattan's Herald Square, New York on January 11, 2019. Photo: DON EMMERT/AFP/Getty Images

Real estate value is another key consideration

Macy's efforts to monetize real estate have also played into some of its recent store closing announcements. While virtually all the company's stores are profitable, for certain locations, the real estate value exceeds the value of continuing to operate the store.

Among the current batch of store closures, the store in Sunnyvale was sold to a developer for $40 million in early 2015. It will be demolished as part of a redevelopment of that mall. The McLean store was the most valuable property among four sold to a major mall owner for a total of $46 million in late 2016. More recently, Macy's sold the Nanuet store for $11.5 million.

There will be more downsizing ahead

A few months from now, Macy's will have completed a little more than 90 of its 100 planned store closures. That would still leave a few locations to be shuttered in 2020 or beyond. Furthermore, Macy's may ultimately decide to shrink its store footprint even further.

In the Chicago area, it has sold a full-line store and two stand-alone furniture galleries in the past year. All three locations are still operating today, but will eventually be redeveloped. It is also looking to sell the ground lease for its Bloomingdale's Home store in downtown Chicago. The company may identify other valuable properties to sell during the coming year.

Looking further ahead, the company will also evaluate whether to close underperforming stores as their leases expire. It could continue a recent trend of consolidating some of its home stores and furniture galleries into nearby full-line stores as well.

Macy's stabilized its performance in 2018, but it will need to continue adapting to reflect fast-changing business conditions. Even after its planned 2019 store closures, there will be nearly 600 full-line Macy's stores in the U.S., plus dozens of home and furniture locations. That's probably more than it needs in the long run. As a result, investors should expect to see more downsizing moves in the years ahead.

This article originally appeared in The Motley Fool.

Adam Levine-Weinberg owns shares of Macy's. Adam Levine-Weinberg is a senior Industrials/Consumer Goods specialist with The Motley Fool. The Motley Fool has no position in any of the stocks mentioned. The Motley Fool has a disclosure policy.