After a somewhat lackluster 2016, this has been a much better year for Phillips 66 (NYSE:PSX). Thanks to an improvement in market conditions in the company's core refining business and the impact from recently completed midstream expansion projects, the energy logistics and manufacturing company's earnings have improved, which gave it more cash to return to shareholders. Those two catalysts have helped fuel a 17.5% total return for investors through early December.

Here's a look back at Phillips 66's year and how it sets the stage for potentially higher returns in the coming year. 

An oil refinery at sunset with long shadows.

Image source: Getty Images.

Refining bounced back

The refining industry was under intense pressure in 2016 due to several headwinds, which weighed on Phillips 66's refining business and pushed profits down from $2.5 billion in 2015 to just $277 million last year. However, many of those challenges went away this year, which enabled Phillips 66's earnings to rebound, with refining segment profitability hitting $779 million through the third quarter.

One of the keys to that rebound has been the significant improvement in margins. Last quarter Phillips 66 noted that the spread between where it buys oil and sells gasoline jumped 24%, helping push its per-barrel margin from $8.44 in the second quarter up to $10.49 in the third. In addition to that, the company's refineries ran at 98% capacity last quarter, up from 93% at the end of last year, which enabled it to take greater advantage of those higher margins.

Expansion projects fueled midstream growth

The other highlight this year has been the company's midstream segment, where year-to-date earnings rose to $208 million, versus $154 million in the prior-year period. One of the drivers of that improvement was the recently finished Bakken Pipeline, which helped add $24 million in earnings to Phillips 66's transportation business during the third quarter. That helped offset lower results from the company's investment in DCP Midstream (NYSE:DCP), where income dropped to just $1 million last quarter, down from $13 million in the second quarter due to commodity price volatility.

Meanwhile, earnings from its midstream unit could see an additional boost by year-end due to in-process growth projects at both of the company's MLPs. DCP Midstream, for example, expects to finish the expansion of its Sand Hills NGL Pipeline by year-end, which should provide a boost not only to its earnings but those of its joint venture partner Phillips 66 Partners (NYSE:PSXP). In addition to that, Phillips 66 Partners' STACK joint venture in Oklahoma expects to finish an expansion project by year-end.

A storage tank with the sun rising in the background.

Image source: Getty Images.

One more big boost on the way

In addition to the in-process growth projects at its MLPs, Phillips 66's chemicals joint venture with Chevron (NYSE:CVX) is putting the final touches on a major expansion. During the third quarter, Phillips 66 and Chevron started up two new chemical producing units in Texas, and the partners are nearing completion on a third project at that facility, which should start producing in the first quarter of next year. These three plants will combine to increase the chemical-producing capacity of the Chevron-Phillips 66 joint venture by one-third, which should fuel meaningful earnings and cash flow growth in the coming year.

Setting the stage for higher returns

These recent and upcoming project completions should continue driving Phillips 66's profits higher in the coming year, which could give the company's stock the fuel needed to maintain its upward momentum. The company also recently authorized an additional $3 billion stock buyback, which would bring its total share repurchases up to $12 billion since it launched the program in 2012. Add to that the fact that the company plans to continue growing its dividend, and 2018 could be as good as (if not better) than 2017.

Matthew DiLallo owns shares of Phillips 66. The Motley Fool has no position in any of the stocks mentioned. The Motley Fool has a disclosure policy.