Image copyright EPA Image caption The advisers had been with Theresa May in the Home Office

Theresa May's two key advisers have resigned after a disastrous election campaign. Who are they and how much responsibility did they really have for what went wrong?

Their fingerprints were all over several of Mrs May's policies and they had a very firm grip on the keys to her door.

The close-knit trio - made up of the bearded Brummie big-thinker Nick Timothy, the boisterous and cavalier Scot and former hack Fiona Hill, and their boss, Theresa May - go back seven years to when they all worked together at the Home Office.

Both Ms Hill and Mr Timothy already had roles within the Conservative Party before becoming the then-home secretary's special advisers.

Image copyright WPA Pool Image caption Some Conservatives want Theresa May to change her approach

With a first-class degree in politics, Mr Timothy had entered the party's research department and was already known to have advised May on a range of issues when she was in the shadow cabinet.

Following her work as a journalist, Fiona Hill had swapped sides to become a Tory press officer.

Once appointed as Theresa May's joint chiefs-of-staff - in a department tasked with keeping citizens safe and secure - both Ms Hill and Mr Timothy were adamant their boss would be heavily protected too. One former minister told me they were "her Praetorian Guard".

Coalition in 2010 brought the need for partnerships in power but within 24 hours of his new ministerial post at the Home Office, the Liberal Democrat Norman Baker said Mrs May's coterie had already briefed against him in the press. He battled to influence policy but found it akin to "walking through mud".

It's difficult to tell whether the stubbornness Theresa May displayed at times - I was told by one former government adviser "turning her is like turning the Titanic" - rubbed off on her advisers or whether it was already their style.

Such close teamwork often results in close political confidants becoming a reflection of their master's image.

A former senior Tory insider said they ran the operation with unremitting hostility towards people and told me "they thought it was advantageous to pick fights in empty rooms".

Image copyright Getty Images Image caption Lynton Crosby is another strategist whose tactics have been questioned

Reflecting on their resignations, the adviser gave this assessment: "Ultimately you need political capital and coalitions in politics and they didn't have that and that's why they had to go so quickly."

But during their time in office, those same close relationships meant Mrs May's key advisors' personal beliefs were to help shape government policy.

Issues like promoting grammar schools, combating mental illness, the Modern Slavery Act, stop and search reforms, a reticence towards nuclear power - all stemmed from May's "enforcer and brains trust" team of Nick and Fiona, as one former adviser said.

But after four years, their tight teamwork was abruptly ended, for the first time, when the behind-the-scenes tactics came to the fore.

Fiona Hill resigned after briefing on an increase of extremism in schools, publicly pitting her boss against the then-Education Secretary Michael Gove.

Image copyright AFP Image caption A dispute with Michael Gove led to Fiona Hill's first resignation

Nick Timothy soon left too after a row with the party when he refused to campaign against UKIP in a by-election.

But it was the uncharted political landscape caused by the Brexit vote that threw them an unexpected lifeline back into mainstream politics.

As soon as David Cameron announced his resignation, hours after he lost the vote in 2016, they were drafted in to run Theresa May's Conservative leadership campaign.

Soon after, they followed Theresa May into No 10 and their influence has been immense.

In fact, a picture soon emerged of their overarching power over the PM's policies, diary and decision-making.

One former minister complained to me that "nobody could get access to them - including her own ministers".

As an illustration of what the relationship was like between Ms Hill and the prime minister, I was told by a number of sources that Ms Hill would on occasion boss her boss around. A former minister said Fiona Hill would "tell her what to do and tick her off".

Image copyright PA Image caption Ben Gummer played a key role in the manifesto but lost his seat in the election

I asked if anyone else did that to Mrs May. "No-one else other than her husband," my source replied.

One Tory insider who knows both Fiona Hill and Alastair Campbell well had an interesting observation about how each dealt differently with selling tough news.

Where Tony Blair's so-called bodyguard would try to deploy charm, Ms Hill could become "aggressive".

I'm told it wasn't just in her dealings with the press but also with senior cabinet ministers, either in person or via text messages.

This sort of behaviour may have, in the end, undermined the many successes the team enjoyed, and made surviving a bad election result almost impossible.

As Mr Timothy wrote as he announced his resignation, the trio had just helped win "more than 13.6 million votes, which is an historically high number, and more than Tony Blair won in all three of his election victories", only to be thwarted by "an unexpected surge in support for Labour".

Perhaps too they were thwarted by a lack of goodwill among even the closest of co-workers.

Image copyright Rick Findler

By overseeing policy in the much-criticised election manifesto, Nick Timothy undoubtedly made some mistakes, leaving the prime minister exposed.

One former government adviser told me privately that Mr Timothy and Ms Hill weren't solely to blame for the problems besetting the beleaguered PM but they were a significant part.

"Like their boss," the adviser said of the PM's gatekeepers, "they skated on foundations a mile wide and an inch thick. They lacked flexibility, charm and a listening mode. Hill in particular never understood you don't have to shout, you have to communicate."

So how will Theresa May cope without them?

Her colleagues will be looking for her to become more collegiate. A former minister said she has not spent much time cultivating friends in Parliament, leaving her without many.

Without Nick Timothy's presence, we may start to notice shifts in government policy, such was his influence - including on big-ticket items like the government's approach to the Brexit negotiations.

Much will of course be determined by who Mrs May picks as their replacements, but it's too early to say how comfortable she will be surviving without them.