EQT Corp.’s five-month search for a new CEO has come to an end in-house, with the company tapping current CFO Robert J. McNally to lead the company.

McNally is set to take over after EQT completes the separation of its upstream and midstream businesses. He would relieve David Porges, who was thrust back into the role of CEO after Steven Schlotterbeck abruptly resigned in March over a compensation disagreement. Schlotterbeck left the company one year after being named chief and guiding it through the $8 billion acquisition of Rice Energy Inc. to become the nation’s largest natural gas producer.

In the wake of the acquisition, as shareholders pushed management to create more value, EQT got to work on a series of transactions to simplify its corporate structure. All of the midstream assets, including those formerly owned by Rice Midstream Partners LP, also merged with EQT, are being dumped into a new publicly traded company to be called Equitrans Midstream Corp.

McNally, who led the second quarter earnings call last month, said at the time the complex tax-free spin-off could be completed before the end of the year.

In another management shake-up, EQT said Jerry Ashcroft, who was previously announced to lead the new midstream company, has been “relieved of all duties with EQT and its subsidiaries.”

Instead, current board member Thomas F. Karam is expected to become CEO of Equitrans Midstream post-separation, at which point he would resign from EQT’s board. He has already been appointed president of midstream for EQT and has assumed the roles of president and CEO of the general partners of EQT Midstream Partners LP and EQT GP Holdings LP. Karam, who has 25 years of energy sector experience, was appointed to EQT’s board last year.

When asked about Ashcroft’s departure, spokesperson Natalie Cox said “the board of directors evaluated what would be in the best interests of the new midstream company and its shareholders going forward, and determined that Tom Karam was the right person for the job.” She added that “Karam has significant industry experience, including leadership roles for publicly traded companies.”

McNally’s ascent came quickly. He was hired as CFO in March 2016 to replace Philip Conti, who retired. He has more than 24 years of experience in the energy sector and previously worked for Calgary-based Precision Drilling Corp.

As part of the leadership shake-up,Porges will step down as EQT chairman and be replaced by board member James Rohr. Porges is to become chairman of Equitrans Midstream’s board once the separation is complete.

EQT is still awaiting the receipt of a private letter ruling from the Internal Revenue Service with respect to the tax treatment of the midstream transaction and has to make a key filing with the U.S. Securities and Exchange Commission before the separation can be completed. Final approval and declaration of the spin-off dividend must also be made by the board.