Media playback is unsupported on your device Media caption Stephen Miller: The man behind Trump's immigration plan

The president turns to an array of people inside and outside the White House for advice. But the most prominent - and perhaps influential - is Stephen Miller.

During the middle of the weekend shutdown, one of the sticking points preventing an agreement was what Congress should do about "dreamers" - immigrants brought illegally to the US by their parents as children.

Miller, a senior policy adviser, didn't want the president to give up ground, according to Republican Senator Lindsey Graham.

"As long as Stephen Miller is in charge of negotiating immigration, we are going nowhere," Graham said. "He's been an outlier for years."

Later, White House spokeswoman Sarah Sanders pushed back. Miller supports the president's agenda, she explained, not his own.

Image copyright BRENDAN SMIALOWSKI Image caption Stephen Miller, says a White House official, is "here to push the president's agenda"

So how much sway does Miller have over Trump? He and other advisers work with the president on drafts of speeches - it's a set-up common to previous administrations.

But until now, all of the US presidents had previously held elected or appointed offices or served in the military. Trump, a businessman, does not have the same grasp of policy, says Matthew Dallek, the author of a book about Ronald Reagan.

So Trump turns to Miller for help.

The 32-year-old transforms the president's ideas into policy speeches and, says Central Connecticut State University's Jay Bergman, makes them accessible "to the layman".

He also knows his audience.

"Miller understands Trump's base from a rhetorical standpoint and also a policy standpoint," says Matt Mackowiak, a Republican consultant and chair of the Travis County Republicans in Texas. "That's what makes him so effective for some and dangerous for others."

Here are four ways Miller has helped to sway the president.

1. Championing the leader

Trump surprised people with his darkly-toned inauguration address and its reference to "American carnage". The speech was written by Stephen Bannon, the president's former chief strategist, Miller and others.

For some watching, this portrait of America was simply Trump telling the truth about a country that had lost its way. But his critics saw it differently.

The apocalyptic vision is typical of authoritarian leaders, says New York University's Ruth Ben-Ghiat, the author of a book about Mussolini. The basic idea is society has become decayed and corroded and needs to be purified.

With Bannon gone, Miller now has more power in the White House as the remaining hardliner on immigration and nationalism. He's reinforced his position by championing the president.

Miller said on television last year that the president's decisions "will not be questioned" and has also described Trump as "the most gifted politician of our time".

Methodology: Miller enhances the president's self-image - "leader glorification", says Ben-Ghiat, underscoring a core message - "He's your saviour."

2. Securing borders

Miller wrote new lines about the case of Kathryn Steinle, a woman killed by an undocumented Mexican immigrant, for the president to give at a Florida rally in December.

An administration official explained that Miller tried out these lines at the rally in order to see what resonated with the friendly crowd.

Media playback is unsupported on your device Media caption The missing - consequences of Trump's immigration crackdown

"He said he didn't know it was a gun," Trump said, referring to the defence lawyer's claim that the 2015 shooting was an accident, adding the US was facing drugs and gangs "pouring into our country".

Trump followed up that reference by mentioning "we have begun the process of building a wall at the border". The crowd roared.

Afterwards Miller walked up the steps of Air Force One and spoke to colleagues about the speech. He was pleased, said one of them, with the crowd's reaction.

Methodology: Miller comes up with language for the president, testing lines on a supportive, local audience before using them in a speech for a national audience.

In this case, he encouraged the president to renew his call for the wall, a popular motif among his supporters.

3. Attacking the media

Miller supports the president by amplifying his critique of the press.

In January, Miller appeared on CNN, accusing the network of "spectacularly embarrassing false reporting" in a fiery exchange with Jake Tapper.

Miller refused to answer his questions, the presenter claimed, because there was only "one viewer that you care about right now".

The interview ended abruptly. Shortly afterwards, Trump tweeted Tapper had been "destroyed" in the interview.

Methodology: Miller turns up the volume of the president's criticism and encourages him to act more aggressively towards the media.

4. Promoting America First

Miller helped shape the president's policy towards Europe by deleting material in a speech about Nato - against the wishes of other White House advisers.

An advocate of national sovereignty who supported Brexit, (and has hung out with Nigel Farage), Miller cut lines in the speech expressing commitment to Article Five, a promise to help other nations in the face of military aggression, according to individuals who are close to Miller.

Article Five is a core tenet of the almost 70-year-old mutual defence pact.

Image copyright Getty Images Image caption Trump's speech to fellow Nato members was notable for what it didn't say

Trump mentioned Article Five, but he didn't give it the endorsement that some of his advisers had wished.

Afterwards reporters gathered around a table with White House officials in a back room at Nato headquarters in Brussels and asked if the US commitment to the alliance was wavering - while Miller paced around the room, looking annoyed at the questions.

Methodology: By removing material from the speech, Miller helped to nudge the president into showing publicly - and in a new way - his ambivalence about Nato.

The rise of Miller

grew up in Santa Monica, California, a liberal enclave, and his parents were Democrats

expressed right-wing views and a passion for guns while in high school, wrote a conservative column at Duke University, North Carolina

worked for then-Senator Jeff Sessions, and he became close to Steve Bannon, who was then head of Breitbart News

joined the Trump campaign in Jan 2016, travelling with the candidate and being the warm-up act at rallies

Read more