Berkshire Hathaway (BRKA) agreed to a $1.4 billion deal to acquire a Phillips 66 (PSX) unit that specializes in maximizing the flow potential of pipelines, as the energy and refining giant continues to reshape its portfolio.

Phillips 66 will receive roughly 19 million Berkshire shares in the stock deal. The exact number of shares will be determined by the share price at the time of the transaction’s close, which is expected in the first half of 2014.

Phillips Specialty Products, a wholly owned subsidiary of Houston-based Phillips 66, develops polymers that improve the flow of oil through pipelines. According to the company’s website, Phillips Specialty Products’ offerings include petroleum coke, waxes, solvents and other products.

“I have long been impressed by the strength of the Phillips 66 business portfolio,” said Warren Buffett, Berkshire’s chairman and CEO. “The flow improver business is a high-quality business with consistently strong financial performance, and it will fit well within Berkshire Hathaway.”

James L. Hambrick, CEO of Berkshire-owned chemicals company Lubrizol, will oversee the strategic direction of Phillips Specialty Products, Buffett added.

Phillips 66, which ConocoPhillips (COP) spun off in 2012, is in the process of refocusing its portfolio on making transportation fuels and chemicals in the U.S. It recently unveiled increased investments at its petrochemical business, Chevron Phillips Chemical, a joint venture with Chevron (CVX).

The company continues to market gasoline at about 7,000 independently owned gas stations.

Phillips 66 CEO Greg Garland noted that Berkshire “made a strong offer” for the flow improver business.

The deal with Phillips is the latest energy move for Berkshire, which acquired a $3.7 billion stake in ExxonMobil (XOM) last month. Berkshire also cut its stake in ConocoPhillips by 20 million shares to about 3.5 million.

Shares of Phillips 66 rose 1% to $75.50 in pre-market trading Tuesday. Class A shares of Berkshire closed Monday at $177,069.20.

Follow Matthew Rocco on Twitter @MatthewRocco