Tech company Shopify (SHOP 0.23%) slashed costs drastically over the past several months in an effort to improve its weak bottom line. It laid off staff, and it recently announced that it would be selling its logistics business.

It doesn't come as a huge surprise that the company needs to scale back on expenses. Shopify has often been too aggressive in its growth strategy, and that has hurt its financials. The question for investors is whether the company has learned from this past mistake.

Shopify tried to do too many things

Shopify came into its own by making it easy for people with little to no tech experience to launch their own e-commerce sites and sell products and services online. It was quite successful with this business model. Where the company made its mistake was in becoming too broad and too aggressive with its efforts. 

In 2019, for example, Shopify opened a TV and film production house called Shopify Studios. The site remains up and running, stating that it "develops, produces, and finances an array of content" in "spotlighting facets of the entrepreneurial journey." While it's likely not a large venture, it's an example of the company perhaps focusing on areas that it doesn't need to spend money and resources on.

Logistics is another example. Aiming to offer two-day delivery was an ambitious goal for the company but one that might not have made much sense for a business whose operating income in 2021 was just $268.6 million, or 6% of its top line. And that was when the company was in the midst of the pandemic-related sales boom when people were spending lots of cash on just about everything. Last year, the business was back deep into the red, with operating losses totaling $822.3 million, even as annual revenue jumped 21% to $5.6 billion.

Getting into a logistical battle with the likes of Amazon, whose annual operating profits are routinely north of $12 billion, doesn't seem like it would have paid off for Shopify. And less than a year after completing its acquisition of fulfillment company Deliverr, Shopify is already retreating from that strategy.

Cutting costs is a crucial step for Shopify's business

In May, Shopify announced that it would be selling its logistics business to Flexport, and that sale would include Deliverr. While Shopify will retain an equity stake in Flexport, it marks a big change in the company's strategy.

Shopify's president, Harley Finkelstein, summed it up by saying, "This allows Flexport to do what they do best, and allows Shopify to go back to doing what we do best, which is building incredible software for e-commerce." The company also announced it would be reducing its workforce by 20%. This comes after it announced last July that it would be cutting 10% of its staff.

These moves are all necessary as Shopify's revenue growth slowed while its expenses became bloated. For the three-month period ending March 31, sales totaled $1.5 billion and were up 25% year over year. But the cost of revenue during that stretch rose by 40% to $791 million. Meanwhile, operating expenses also jumped by 24% to $910 million. 

Shopify is a much better investment now

Share prices of Shopify jumped as investors learned of the layoffs and the company announced it was ditching its logistics business. Simplifying operations and becoming leaner often result in better margins and overall profitability.

Trying to do too much and too many things are what can get a business into trouble. It happened to Amazon and other tech giants that overestimated their growth opportunities. The same thing happened with Shopify. Getting back to what made the business successful and focusing on its e-commerce platform is what can set the stock up for a rally. 

The tech stock is on the rise again in recent months, and if these cutbacks get the company's earnings back into the black, Shopify could soon be a hot stock to buy again.