A slew of analysts have upgraded the stock and boosted their price targets after the online retailer’s revenue surged and gross margin expanded.

Shares surged 16% to $227. The stock is now up 31% this year.

Amazon’s bottom line has struggled over the past year as the company has invested heavily in improving and upgrading its warehouses, technology and Kindle electronic devices.

The heavy spending had been one of the major concerns weighing on the stock. But analysts are now shifting their tune a bit, saying investors will reap the benefits of heavy spending sooner than later.

“We believe the investments that the company is making with consumers, merchants and enterprise will largely pay off,” says Ken Sena, an analyst at Evercore Partners.

At least three Wall Street firms — Goldman Sachs, Bank of America Merrill Lynch and Nomura Securities — raised their investment ratings to “buy” from “neutral.” The big takeaway is margin expansion could keep pushing the stock higher from current levels.