CVS Health (CVS  ) is making its way through a changing healthcare landscape as one of the nation's largest pharmacy companies. Despite optimizations in its real estate division, it still opted to close down 22 more stores that it deemed underperforming. This adds to 46 stores that had been closed earlier in the year and a planned 75 stores shutting down next year. This came on the heels of an earnings report that beat expectations in both earnings per share and revenue and an announcement from rival Walgreens (WAG  ) that it planned on shutting down 200 stores in the middle of its own cost optimization strategy.

Against analyst expectations of $1.77 a share, CVS beat those expectations by 7 cents a share for a total of $1.84 in earnings per share. Additionally, the drugstore giant posted revenues of $63.81 billion, nearly $1 billion higher than estimations of $62.99 billion. CVS Health's large increase in revenue it owed in part to the acquisition of healthcare company Aetna, which took place last November. The retailer is trying to hold on in the face of a rapidly changing retail environment that has led to thousands of store closures in all sorts of industries over the past few years. This includes plans from Costco (COST  ) and delivery service Instacart to roll out a prescription delivery service in several states.

In that recent earnings report, CVS reported a "store rationalization charge" of $96 million that resulted from the closure of these 22 stores. This followed a charge of $135 million that it had reported earlier in the year from the closure of the aforementioned 46 stores. In addition to these store closures, CVS is opening up a new line of stores they call HealthHUB, which emphasize a greater range of healthcare services than the typical CVS location. With these recent store closures and changes to the way it runs business, CVS hopes to stay ahead of the curve in a rapidly changing market for health services.