One of the more interesting legal phenomena of the Trump administration has been the attention paid to previously obscure federal statutes—and how the legal authorities they provide can be abused by a president who isn’t bound by ordinary political checks and conventions.

Consider what’s happening this week with the Department of Homeland Security. On Sunday, right after announcing that Secretary Kirstjen Nielsen would be resigning (almost surely at the president’s insistence), President Donald Trump announced that he was naming Kevin McAleenan—the commissioner of Customs and Border Protection—as acting secretary. After apparently discovering that federal law requires that the under secretary for management—Claire Grady—become acting secretary in such a case (because there is currently no Senate-confirmed deputy secretary), the White House announced on Monday that it was removing Grady (a Trump appointee), apparently for no other reason than to clear the way for McAleenan.

The Federal Vacancies Reform Act is the law that allows the president to bypass the background assumption that, when a government office is vacant, the next person in line to hold that office can exercise its functions on an “acting” basis. Thus, it was the FVRA that allowed the president to name Mick Mulvaney acting director of the Consumer Financial Protection Bureau even though that agency had a Senate-confirmed deputy director. It was also the FVRA that allowed the president to name Matthew Whitaker as acting attorney general even though Rod Rosenstein was the Senate-confirmed deputy attorney general. And Trump presumably intended to use the FVRA to appoint McAleenan over Grady as acting DHS secretary before he realized a different statute got in the way.

Vacancies are inevitable in the executive branch. Even if the government tries to avoid long periods with unfilled offices (which used to be norm for the secretary of defense—an office that has now been vacant for a record 99 days), some departures will always be unplanned. But it is not inevitable that the president should be able to fill vacancies however he sees fit and for however long he desires.

The Constitution is quite clear that the Senate is supposed to play a role—“advice and consent”—in the conformation of senior government officers. The more Trump relies upon the FVRA to fill vacancies on a temporary basis, the more he is depriving the Senate of its constitutional role—and in the process, of opportunities to vet his nominees, to reject those who are unqualified, and to conduct meaningful oversight of the executive branch.

Indeed, Trump has made no bones about his preference for relying on “acting” department heads as an end-run around the Senate. As he put it in January, “I like acting [officers]. It gives me more flexibility.”

But what Congress giveth, Congress can—and should—take away. There are several reforms Congress should adopt that would preserve the ability of Trump (or his successors) to temporarily fill otherwise unfillable vacancies without so transparently bypassing the Senate’s constitutional role.

First, time limits. One of the FVRA’s innovations was supposed to be an overarching time limit on all “acting” appointments. But the statute’s generous grace period—210 days—can be extended, perhaps indefinitely, so long as the president nominates someone to hold that office on a permanent basis, even if the Senate never acts on the nomination. This should be fixed. The time limit should be reduced to 60 days, subject to extension if and only if the president nominates a permanent successor during that period, and only until the Senate formally approves or rejects the nomination. Thus, so long as the president nominates a permanent successor within 60 days, the ball would be in the Senate’s court—to decide between confirming the president’s nominee, rejecting the nomination, or not acting on it (thereby leaving the acting officeholder in place).

Second, even with such tightened time limits, Congress should be more specific about who the president may name as an acting officeholder. Under the FVRA, the president can choose between the “first assistant” to the relevant position (for Cabinet secretaries, this is typically their deputy); any officer holding a Senate-confirmed position anywhere in the executive branch; or certain non–Senate-confirmed senior officials within the same agency as the vacancy.

The more Trump fills vacancies on a temporary basis, the more he is depriving the Senate of its constitutional role.

A better approach would be to require the president first to choose the “first assistant”; then, if that office is also vacant, from any Senate-confirmed officer in the same agency; then, to name a non–Senate-confirmed senior official only if no Senate-confirmed officers from that agency remain; and finally, to name a Senate-confirmed officer from a different agency only if no qualifying senior officials from the same agency remain (an issue more for smaller agencies than for larger ones). This way, the president must, in the first instance, rely upon the individual who is supposed to be next in line, and then someone the Senate confirmed to the same agency. Under this approach, the president could only take advantage of the statute’s flexibility when it’s truly necessary.

Of course, as with this week’s DHS contretemps, the president could simply fire the first assistant and all of the other Senate-confirmed officers in an agency in order to create conditions that would allow him to name someone else. But in a world in which the Senate could also refuse to confirm any of the president’s nominees, some degree of flexibility in extremis seems necessary to prevent giving too much power to the legislature.

Finally, Congress should also consider limiting the functions that acting agency heads should be allowed to perform. Acting agency heads are usually allowed to take virtually all of the same actions as a permanent holder of that office, but only because Congress has so provided. Nothing would stop Congress from denying acting agency heads the power to, among other things, rescind regulations promulgated by Senate-confirmed predecessors, take action to apply regulations the agency has promulgated, or a host of other steps that would create strong incentives for a president to prefer a Senate-confirmed officer—to reduce the “flexibility” Trump so unabashedly enjoys.

It is easy to see how a Senate hostile to a sitting president could try to use such a constraint as a weapon—depriving a president of the power to implement his agenda by refusing to confirm anyone he nominates to any post. But there’s any easy fix for this concern: Congress should condition the reduction of an acting officeholder’s powers on the president’s refusal to submit a nominee to permanently hold that office.

Such a measure would mean that a president who wants an acting officeholder to have full authority need only send a name to the Senate (which, per the time limit proposal, would either confirm the nominee, reject the nominee—terminating the acting officer’s authority—or take no action, leaving the acting officer with full authority). So conceived, an acting officeholder’s power would only be reduced if the president refuses to even name a permanent nominee (as Trump has done with the secretary of defense). And if the president names an unconfirmable nominee as a ploy to give the acting officeholder full authority, the Senate can quickly vote to reject the nominee, thereby also terminating the acting officeholder’s ability to hold the office.

In other words, there’s a way to thread the needle so that all of the incentives militate in favor of the regular appointments process, regardless of whether the president and the Senate are on the same page or at loggerheads with each other. And it’s hard to imagine how these reforms would raise constitutional concerns. Even the staunchest defenders of the “unitary executive” theory of presidential power concede that the Senate is supposed to play a role in the appointments process and that allowing long-term acting officeholders is itself a constitutional problem.

Congress probably can’t limit the class of individuals whom the president can nominate on a permanent basis, but the FVRA itself limits the class of individuals who can serve as acting officeholders. This proposal only tightens those existing constraints. Nor is there any argument against Congress’ power to reduce the authority of acting officeholders vis-à-vis their permanent predecessors and successors. There are some statutes that already so provide, and as a general matter it is up to Congress—not the president—to define the duties and authorities of offices it creates.

These proposals would go a long way toward Trump-proofing the federal vacancies regime—and in the process, better balancing the president’s right to control the bureaucracy he oversees with the Senate’s constitutional responsibility to play a role in deciding who may hold the most important executive branch offices. It should be a no-brainer for any Congress to enact—which, sadly, means it likely has no chance in this one.