The Consumer Financial Protection Bureau has been a political hot potato since the day it was created as part of the legislative response to the 2008 financial crisis.

A brainchild of then-Harvard law professor (now U.S. senator) Elizabeth Warren, the bureau was established in 2010 as an independent agency through the Dodd-Frank Wall Street Reform and Consumer Protection Act. It was intended to serve as a consumer watchdog, investigating consumer complaints and regulating banks and other financial institutions, among other things.

In January 2012, President Barack Obama installed Richard Cordray via a recess appointment to serve as the bureau’s first director. Obama’s action was highly controversial (and likely unconstitutional in light of a later Supreme Court ruling) because the Senate was not in recess and was still holding pro forma sessions at the time.

The Senate ultimately confirmed Cordray in July 2013.

Since its inception, there have been, and continue to be, numerous legal challenges to the structure of the Consumer Financial Protection Bureau, which is run by a single person who, unlike in other agencies, can only be fired by the president for “inefficiency, neglect of duty, or malfeasance in office,” and whose budget comes from the Federal Reserve and is not subject to approval or disapproval by Congress.

Critics charge that this violates constitutional separation of powers principles and enables the bureau to function like an unaccountable, unauthorized separate branch of government.

It had long been rumored that Cordray, the former attorney general and state treasurer of Ohio, would resign in order to run for governor of Ohio when John Kasich’s term expires next year. Cordray informed the bureau’s staff of his intention to step down in mid-November, leaving the precise date of his departure a mystery.

It had also been rumored that President Donald Trump would designate Mick Mulvaney—the director of the Office of Management and Budget—as interim director of the bureau once Cordray left the agency.

Mulvaney is a longtime critic of the agency, having referred to it as “a sick, sad joke” and a “wonderful example of how a bureaucracy will function if it has no accountability to anyone.”

Mulvaney has called for an overhaul of the agency and a diminution of its budget. The president appears to agree, tweeting on Saturday that the agency “has been a total disaster as run by” Cordray.

As a parting gift, and in an attempt to stymie the president, Cordray suddenly announced last Friday that he would be leaving at the end of the day and that he was promoting Leandra English—who is said to be close to Warren—to the position of deputy director, replacing acting Deputy Director David Silberman, who had been serving in that capacity for two years. Cordray said she would assume the position of acting director upon his departure.

In doing so, Cordray cited a provision in the Dodd-Frank Act that states the deputy director “shall … serve as the acting director in the absence or unavailability of the director” until such time as the Senate confirms a new director.

Within hours after Cordray’s announcement, Trump named Mulvaney as acting director of the agency.

Not going down without a fight, English has now filed a lawsuit against the Trump administration in federal court in Washington, D.C. Calling herself the “rightful acting director” of the bureau, she contends that Trump’s “purported or intended appointment of defendant Mulvaney as acting director of the [bureau] is unlawful” and has asked the court to enter an order preventing Mulvaney from assuming the position and establishing her authority as acting director.

It is, of course, highly questionable both from a legal and policy standpoint whether an unaccountable director of an independent federal agency should even be permitted to appoint his own successor.

In this case, though, there is no need to address these knotty questions because the president is on firm legal ground by naming Mulvaney as acting director of the bureau.

The Federal Vacancies Reform Act of 1998 provides—with limited exceptions not applicable here—that the president can designate any Senate-confirmed official (which would include Mulvaney) to perform the duties of a vacant federal office in an acting capacity for a statutorily limited period of time.

This law provides the exclusive means for filling such vacancies, unless some other statutory provision provides an alternative method or “designates an officer or employee to perform the functions and duties of a specified office temporarily in an acting capacity.” It is this language that English and her supporters are relying upon.

Such reliance is misplaced, however.

On Nov. 25, the Office of Legal Counsel—the office within the Justice Department that serves as a legal adviser to the president and all executive branch agencies—issued a legal memorandum supporting Trump’s ability to designate Mulvaney as acting director, concluding that Trump has the authority to name an acting director under the Federal Vacancies Reform Act.

While acknowledging that the Dodd-Frank Act permits the deputy director to serve as temporary director, the Office of Legal Counsel memo concludes that the statute “doesn’t displace the president’s authority” to appoint an acting director under the Federal Vacancies Reform Act.

Just because another statute—in this case, the Dodd-Frank Act—provides an alternative means for temporarily filling a vacancy does not mean that the president cannot do so utilizing the Federal Vacancies Reform Act. All that would mean is that the act would not be the “exclusive” means of filling that vacancy.

As the Office of Legal Counsel memo states:

If Congress had intended to make the Vacancies Reform Act unavailable whenever another statute provided an alternative mechanism for acting service, then it would have said so. It would not have provided that the Vacancies Reform Act ceases to be the ‘exclusive means’ when another statute applies.

The Consumer Financial Protection Bureau’s general counsel also issued a legal memorandum over the weekend siding with the president and determining that the arguments advanced by English in her lawsuit are “unpersuasive.”

The president’s position, which was also advocated by the Obama and Bush administrations, was recently reinforced by the 9th U.S. Circuit Court of Appeals—long considered the most liberal federal appellate court in the country—in Hooks v. Kitsap. In that case, the court held that when both the Federal Vacancies Reform Act and another statute provide a mechanism for filling a vacancy, “the president is permitted to elect between these two statutory alternatives” when designating an interim director.

It has been reported that Mulvaney showed up at the Consumer Financial Protection Bureau this morning and immediately took charge, despite the ongoing legal dispute. The odds are extremely high that he will be allowed to remain there and that English will lose her attempt to frustrate the president’s appointment and his agenda.