It has been very hard, ever since he was selected as the president’s national security adviser, to find many nice things about Mike Flynn’s selection. Even those who worked with and admired Mike Flynn when he was one of the most talented military intelligence officers of his generation have largely either stayed silent or openly hoped that Trump’s holy trinity of Marines—Jim Mattis, Joe Dunford, and John Kelly—would be a moderating influence on Flynn within the president’s national security council.

The latest Kremlinology suggests that the Cabinet secretaries will use this past weekend’s incompetence to assert their own power relative to the White House staff, and other reports suggest that even within the White House, Flynn might already be losing influence with the president.

There is no reason why Mike Flynn cannot be a successful national security adviser to the president, though, and there are several indicators to suggest he might be putting the pieces in place to do so, should he survive these first few chaotic weeks. It all depends on the kind of national security adviser Flynn wants to be—and, as my former Pentagon colleague Kelly Magsamen put it—whether the president even incorporates Flynn’s staff inputs into his decision-making process.

Count me among those who enjoyed working with Flynn and admired him when he was Stan McChrystal’s intelligence officer in Afghanistan. I found him smart, funny, hard-working, committed to killing the people who needed to be killed, and—more importantly—not harming those Afghans just trying to survive a brutal civil war.

It’s hard to describe just how bad the intelligence picture of Afghanistan was when McChrystal took command in 2009. I joined his team for a brief period of time and was shocked to discover we didn’t even know who controlled Kandahar, the most important city in southern Afghanistan. Once the intelligence agencies and military surged resources into Afghanistan, the U.S. and coalition understanding of the country improved—and it wasn’t long before the CIA, in particular, was telling a succession of U.S. commanders lots of things they didn’t want to hear about how the conflict was going.

Mike Flynn, to his credit, didn’t wait for the cavalry to arrive. He instead reached out to a wide array of journalists, think tank researchers, and scholars to better understand what was going on in Afghanistan. Together with Matt Pottinger, a junior Marine intelligence officer and former Beijing bureau chief for the Wall Street Journal who was recently named the senior director on the national security council staff for Asia, Flynn authored a scathing report for the Center for New American Security—where I worked at the time—on what he learned about our failures.

But if I admired Flynn as an intelligence officer, you can also count me among those who have been horrified to hear what has come out of his mouth in the past several years, including the chants of “lock her up!” he led at the Republican National Convention this past summer. I am not quite sure what happened during his tenure at the helm of the Defense Intelligence Agency, a notoriously dysfunctional agency that employs some great talent but frustrates its clients (of which I was one until just recently). But people I trust who observed him say he took a straight-forward performance failure on his part and both internalized it—and explained it to others—as a policy disagreement with the administration.

Now that Flynn has parlayed his break with the Obama administration into his new job, though, he seems to be taking steps that could be very positive. First, Flynn is determined to shrink the size of the National Security Council staff, something, to be fair, the Obama administration also resolved to do but had difficulty achieving. As others have said, if you want to make a staff more strategic, cut it in half. Although it should be acknowledged that even a small number of people can also micromanage a process cutting the National Security Council staff could, in theory, both allow it to focus on the key policy decisions while empowering the departments and agencies in ways they could not have imagined during the Obama years. This seems to be the direction Flynn is heading—especially when it comes to the prosecution of the military campaign against the Islamic State. As several of us crudely told our own staffs before leaving the Pentagon in January, “Mentally prepare yourselves to not ask permission from the White House each time you want to wipe your asses.”

Second, as Josh Rogin and others have reported, Flynn is hiring many retired and active-duty military officers to fill posts on the staff. Flynn says he wants “people who have looked down a rifle scope,” but many of the hires I have seen so far are less trigger-pullers than former intelligence officers like Flynn. So while they may have looked down a rifle scope on the rifle range a few times each year, the majority of their experience is working on military staffs—which is actually really good preparation for working on the national security council staff, where your job is to staff the commander in chief.

A lot of this is also driven by the budget: The National Security Council doesn’t actually have a lot of money, so even some senior Obama administration officials were “detailed” from departments and agencies to whom they never actually reported. So when you’re looking for talent to serve on the National Security Council staff, you have to raid the intelligence agencies, the Foreign Service, and the military—or get people hired into departments and agencies on political appointments who then get detailed back over to the White House.

Each national security adviser is different, and each has a different relationship with his or her president, but broadly, they think of themselves as either the president’s principal strategic adviser (e.g., Henry Kissinger) or the humble referee who adjudicates the disagreements of the departments and agencies and presents them to the president for decision (e.g., Brent Scowcroft). While most national security advisers do a lot of each, they tend to fall into one of the two archetypes. (For more on this dichotomy and the role of the national security adviser, I recommend this excellent address by Steve Hadley, George W. Bush’s former national security adviser, which was recommended to me by a former Obama administration national security counsel staffer.)

It is not clear if Flynn has either the access to the president or the relative power compared with the Cabinet secretaries to be the president’s principal strategic adviser. But given the team he is assembling—and which the president himself is assembling—he could certainly be an effective referee between the departments and agencies. He will have to forge close relationships with the heads of the other departments and agencies—and most especially Mattis, Rex Tillerson, and Mike Pompeo—so that they do not simply go around him to the president or vice president (as Don Rumsfeld did to Condoleezza Rice’s frustration in the early Bush years). The heads of the departments and agencies will have to trust that Flynn, the national security adviser, has already faithfully represented their views to the president.

Flynn, who is also known to develop opinions that he’s not easily moved off of by evidence to the contrary, will also have to learn to trust the incredibly talented people he has working for him. I know several of Flynn’s senior directors and directors quite well, and they know the countries for which they are responsible much better than Flynn does or has the time to know. Flynn needs to lean on and trust those – in many cases, young—experts in the same way he once did junior officers like Pottinger.

Flynn will also need to mentor his deputy, K.T. McFarland, who has precious little experience running the contemporary foreign policy bureaucracy. She may be smart—and I hope that she is—but even very smart people with more recent and extensive policy-making experience struggle to run the interagency process for which the deputy national security adviser is usually responsible. One thing the Obama administration largely lacked was a pool of national security council staffers with prior management experience, either in the military or the private sector. That led to a lot of conversations at very senior levels in which everyone succeeded in sounding very intelligent but no decisions or recommendations for the president were made—just more questions for the departments and agencies. McFarland, for her part, is a cable news personality who last worked on the national security council staff over four decades ago. So it is reasonable to expect her to struggle at first.

Flynn’s biggest challenge will be his boss, who thus far seems more likely to make policy after watching Fox News in the evening and responding to something he heard than after carefully listening to his Cabinet secretaries argue back and forth for two hours in a meeting on Syria. Flynn’s success is highly dependent on the president actually listening to Flynn before opening his mouth on foreign policy. He will need to figure out the best way to get inside his president’s decision-making process, either directly or indirectly. Maybe that means watching cable news with the president late at night (I’m serious), or maybe that means trying to inform the thinking of the most senior advisers (Bannon, Conway, Kushner) the president seems to trust. The latter could be a tough pill to swallow: Having previously enjoyed broad access to the president, Flynn will have to accept that in the White House, he will be one of, if not the most, influential adviser on national security affairs.

Flynn’s final challenge will be himself. He’s not the first staffer to speak too much in a meeting or be embarrassed by the social media posts of a relative, and he has a unique challenge in having two four-star Cabinet secretaries who by all accounts are less impressed by Flynn’s three stars than the president. So to recover his position within the White House and with the departments and agencies, Flynn may have to be as humble personally as he is prepared for his staff to be institutionally.