The retail universe has changed significantly in the past five years. Mass adoption of smartphones and tablets and the rapid growth of e-commerce have given consumers a host of new ways to shop, while making some traditional shopping patterns obsolete. Even as the U.S. has recovered from the Great Recession, some retailers have been left behind due to their failure to adapt to these trends.

Macy's (NYSE:M) has not been one of those companies. In fact, the department store chain has been surprisingly nimble in adapting to the e-commerce revolution. Last week, Macy's demonstrated its forward-thinking attitude yet again through its latest restructuring project.

Pivoting toward e-commerce
In the last half-decade or so, Macy's has heavily emphasized what it calls an "omnichannel" sales strategy. This entails making the in-store and online businesses work together in a seamless manner to ensure a smooth and consistent shopping experience.

This strategy involves harmonizing the in-store and online merchandise collections, using stores as mini-fulfillment centers for online orders, and enabling in-store pickup of online orders.

Macy's is now using stores as mini-fulfillment centers for online orders. Photo: The Motley Fool.

All of these efforts made Macy's an e-commerce leader in the years following the Great Recession. By 2013, annual online sales had reached $3.1 billion (11% of the company total) while growing 40% annually.

Around that time, Macy's stopped reporting online sales growth. Chief Financial Officer Karen Hoguet noted that the company's omnichannel efforts had significantly blurred the boundary between in-store and online sales. (e.g., a customer might order an item online from a smartphone while sitting in a Macy's store.) As a result, Macy's executives decided it was no longer meaningful to report online sales as a separate line item.

Continuing the omnichannel shift
Nonetheless, company executives recognize that e-commerce remains the key to long-term sales growth. One consequence is that Macy's is gradually shrinking its store portfolio.

Macy's will close 14 stores in the next few months, and only plans to open two new stores this year. Most (though not all) of the stores being closed are either outdated or undersized, two factors that tend to drive underperformance.

Macy's strong e-commerce operation makes it easier than ever to retain customers despite closing stores. By shuttering these locations, the company can save on future capital expenditures and on day-to-day operating costs. Meanwhile, the savings is being reinvested in technology and incremental fulfillment capacity for online orders.

Macy's last week also announced a major shift in its corporate structure. The highlight is that Macy's (and its upscale sister-chain, Bloomingdale's) will merge the store and online teams for merchandising and marketing. Previously, separate groups within the Macy's corporate structure were responsible for planning and marketing in-store and online product assortments.

In many ways, this is the final step in erasing the boundary between in-store and online sales. This should improve efficiency by eliminating overlapping functions while also speeding decision making. That said, Macy's will maintain regional merchandising teams to "localize" the product assortments to provide what customers in each market are likely to want.

This trend will continue
Macy's, Bloomingdale's, and their peers are never going to go store-free. Even after the recently announced store closures, Macy's will have about 830 stores spread across the country. While online and omnichannel sales now account for billions of dollars of sales each year, Macy's still gets the bulk of its revenue from traditional in-store purchases.

Stores also function as showrooms for Macy's. Even if customers are ordering online, they might want to see items in person before deciding what to buy. Lastly, stores are carving out new roles as distribution hubs and return centers for online orders.

While all these factors necessitate keeping some stores around, fewer locations will be needed in the future. When the only way to make a sale was to lure customers into a store, it was useful to blanket the country with brick-and-mortar sites.

However, from Macy's current perspective, online sales are just as good as in-store sales. Thus, a smaller store network could be better. That will help Macy's focus its investment dollars on technology and fulfillment to improve the omnichannel experience and increase online sales.