Amazon's (AMZN 0.34%) share price is sitting close to a new all-time high as management focuses on optimizing costs and boosting the company's profits. Analysts at Wells Fargo see more upside for the company's profits that could push the stock higher.

Wells Fargo's investment firm raised its price target on Amazon from $211 to $217. Given its $180 share price at the moment, that represents an upside over the next 12 months or so of just under 21%.

What is fueling Amazon's rally?

Amazon invested heavily to expand its transportation infrastructure during the pandemic and now it's reaping the rewards of those efforts. Operating profit hit a record $13.2 billion in the fourth quarter, but improving efficiency in the online retail business is still an ongoing process.

Wells' analysts specifically cited recent changes to Amazon's fulfillment fees it charges to third-party merchants, which could be quite lucrative. The analysts raised their estimates for second-quarter operating income by $750 million to $14.5 billion. This would mark a year-over-year increase of 202%.

However, investors should note that Wells' estimate is higher than Amazon's guidance, which calls for operating income to land between $8 billion to $12 billion in Q1. Still, Amazon has significantly beaten the consensus earnings estimate over the last four quarters, so some upside to guidance should be expected.

Is it too late to buy Amazon stock?

Amazon's improving top- and bottom-line growth could support new highs this year. On a price-to-sales basis, the shares trade at a multiple of 3.26, which is within its historical trading range over the last five years.

Another 21% rise in the share price would put the valuation close to 4 times trailing revenue. That's pushing the upper range of Amazon's valuation range historically, but it might be justified with Amazon's operating profit margin also heading toward record highs.