Image source: Square.

There was a lot to like about Square's (NYSE:SQ) third-quarter earnings report. It beat analysts' expectations on both the top and bottom lines, and all of its various verticals are firing on all cylinders.

One factor that might get overlooked, however, is the huge potential for margin expansion over the next few years. That will come not only from the growth of higher margin products, but also from the decline of loss-leading products such as its hardware as a percentage of revenue. CFO Sarah Friar expects steady margin improvement every year for the foreseeable future.

It takes over a year to start getting a return on hardware

Square has seen an uptick in hardware sales this year that's outstripping growth in payment volume. That's due to the new requirement to support EMV payments with a chip reader. Hardware sales are up 254% through the first nine months of 2016, and it's taken a loss of $21 million on those sales. Square's introduction of its contactless and chip reader hardware will lapse in December, so investors should expect the growth in hardware sales to slow down significantly next year.

As Square's hardware sales decline as a percentage of revenue, it'll have less of a negative impact on profit margins.

During Square's earnings call, Friar told analysts it takes four to five quarters for Square to break even on its hardware sales by monetizing them through payments. That number has remained consistent, according to Friar.

As long as Square can retain its customers at a reasonable rate -- and there's no reason to think it can't -- its hardware sales present a huge point of operating leverage. While it takes a little over a year for a new seller to become profitable for Square, the operating profit on those customers after the first year grows significantly since the hardware is already in place.

While investors will want to see continued growth in the number of merchants using Square, the growing number of older customers as a percentage of the total means its overall margins will improve.

More high-margin products

Square's software and data products made up about 7% of its revenue, but they accounted for about 14% of its gross profit. Outsize growth in these high-margin products will also propel higher overall profit margins, and Square continues to add new products to the segment.

Its most recent addition is instant deposit. Since its launch just over a year ago, Square has completed 4 million instant deposits, capturing an additional 1% fee on each deposit. That makes it an extremely high margin product that's growing well.

The biggest revenue sources for the software and data segment include Square Capital, its business loan product, and Caviar, its restaurant delivery service. Square Capital loan originations increased 70% year over year in the third quarter to $208 million. That's spread out over 35,000 businesses.

Square hasn't provided as much detail about the growth of Caviar but noted that weekly order volume is up more than elevenfold since it purchased the company in August 2014.

Software and data products ought to be Square's fastest-growing segment for some time to come. It grew 149% through the first nine months of 2016. As it grows as a percentage of revenue, margins will naturally increase.

With two factors working in Square's favor -- an expected decline in loss-leading sales as a percentage of revenue and the growth of higher-margin sales -- investors can expect strong margin improvement for the foreseeable future.

This article represents the opinion of the writer, who may disagree with the “official” recommendation position of a Motley Fool premium advisory service. We’re motley! Questioning an investing thesis -- even one of our own -- helps us all think critically about investing and make decisions that help us become smarter, happier, and richer.