Meet Elizabeth Gardiner, the woman who drafts the UK's laws
Theresa May was not the only person breathing a sigh of relief when MPs approved the government's flagship EU Withdrawal Bill last month.
The woman ultimately responsible for its drafting was also quietly satisfied.
"Someone could have spotted some completely fatal flaw and the entire edifice might have crashed," says Elizabeth Gardiner, head of the Office of the Parliamentary Counsel, which composes government bills.
"That has not happened. The level of scrutiny that has taken place, in my experience, is unprecedented. We are pleased the structure has held up to that kind of scrutiny."
With the bill - which was debated for 85 hours in the Commons - having now moved on to the House of Lords, her team's work is far from over, but she believes it remains in good shape despite being subjected to a blizzard of proposed changes by MPs.
"Given what it is doing and what it is achieving, I think it strikes a very good balance," she says.
"A week after the referendum, I kept reading things that said this bill, when it came forward, would be three clauses. It is fanciful it could be done in three clauses, but neither is it 300."
The 51 year-old solicitor, the first woman to hold the post of first parliamentary counsel, has a gimlet eye when it comes to making sure bills hold together and, in modern political parlance, are fit for purpose.
After nearly three decades as a parliamentary drafter, she is an accomplished exponent of her art but still expresses a disarming measure of surprise as well as pride at her role operating "at the heart of government".
"I was planning to be a High Street solicitor in some sleepy town in Scotland," she says.
The history of the Office of the Parliamentary Counsel
Bills were originally drafted by normal barristers, MPs themselves or members of the judiciary. William Pitt was the first person to appoint a dedicated parliamentary draftsman.
Barrister Henry Thring was appointed to head the newly created Office of the Parliamentary Counsel to the Treasury in 1869, a post he held for more than 30 years.
The OPC was initially part of the Treasury, but was absorbed into the new Civil Service Department in 1969, changing its name to simply the Office of the Parliamentary Counsel.
That was until she read an "interesting" job advert for a parliamentary drafter in the early 1990s and soon found herself among stimulating although rather different company to that she had been used to.
"The culture of the office then was quite male and Oxbridge, which was not my background. I would probably have found that quite difficult if I hadn't always loved the work.
"I think it is the sort of job that you either love or hate, probably - I think it's a bit Marmitey. People leave very quickly if they don't like it, but there are a lot of people who come and stay a long time."
She was one of those who stayed, in her early years helping to write the Maastricht bill for John Major's government before being caught up in the legislative whirlwind that marked New Labour's early years in office.
"What they used to say was that every Labour government legislated more than a Tory government but that every government legislated more than the previous one, of that colour," she says.
"I have no scientific evidence for that, but we were certainly producing a lot of legislation in the early 2000s."
This put a strain on the department's capacity to do its job as, for different reasons, did the retrenchment in the civil service that followed the coalition government's post-2010 austerity drive.
That period of cuts has now come to an end. She has 48 lawyers at her disposal from a diverse range of backgrounds, working directly on writing government legislation, including six recruited in the past year.
Deconstruct and reconstruct
The "very specialist" nature of the role means there is no ready-made production line for talent as there may be elsewhere in Whitehall and there is a huge emphasis on taking on the right people and then nurturing them.
"Because it takes so long to train someone, we have to be very conscious about the future of the office. You can't just turn on a tap or go out into the market and find someone who can draft legislation."
As part of the recruitment process, candidates are asked to dissect a spoof government bill to determine whether they have the combination of intellectual rigour, analytical powers and flair to do the job.
"There are people who look at it and can spot a few typos and there are others who pull it to bits and explain why it does not work. We need people who can deconstruct but can also reconstruct.
"You do get people who are very good at critiquing other people's drafting but when faced with a blank piece of paper find it extremely difficult to find a way in to creating a structure to produce that."
The drafting process, she says, needs consistency, collaboration and the ability to ask searching questions of ministers and their advisers, who are sometimes "very close to the policy and can't see the bigger picture".
While bills very rarely "collapse" because of internal contradictions, they often end up looking rather different from how they started out.
"One of my colleagues used to describe it as 'You have crafted an elephant and think it is a pretty good elephant and you are half way through Parliament and they decide they want a crocodile.'
"You have got bits of the elephant chopped off and some bits stuck on. At the end of the day, maybe it is a functioning crocodile but not as nice a crocodile as you would have created."
MPs and peers cannot lobby drafters directly on the wording of bills but can, of course, make their own linguistic changes. While "heavily amended" bills present a challenge what worries her more is lack of scrutiny.
"You don't want to assume that no-one in Parliament is saying anything relevant.
"You have to be quite thick skinned. But 999 times out of 1,000, when someone says the bill is not well drafted, they really mean, 'I don't like the policy in the bill.'"
With increasing public interest in the law-making process - the legislation.gov.uk website gets two million hits a year - there has been a deliberate effort to cut out unnecessary jargon and make bills more accessible.
"Most bills won't be as difficult to read as people think they are," she says. "If you compare an act from now to one from the late-1980s, it is written far more in everyday English."
The ultimate test of legislation remains its basic legality, but as a handful of bills over the past 30 years have shown - the 1991 Dangerous Dogs Act, for example - it is equally damaging for legislation to be found wanting in the court of public opinion.
"I sometimes think certain pieces of legislation get a bad name and there is no way back, whether it is based on fact or not," she says.
"There are periods in history - and it is not a comment on the Dangerous Dogs Act particularly - where you would look at the front page of a tabloid newspaper and realise what it was you might be legislating for in reaction to that. There certainly has been some of that."
The risk of kneejerk legislative responses to a personal tragedy or institutional failure will never disappear.
The increasing tendency of ministers to trail proposals in Green and White Papers or publish legislation in draft form well beforehand makes the job easier and in Elizabeth Gardiner's words "strengthens the product".
But there are occasions where this is not possible and the challenge her colleagues face - summarised as producing "clear, coherent" laws that fit neatly within the existing statute book - rises a notch or two.
Brexit is a supreme example of this.
While the EU Withdrawal Bill is an "unprecedented intellectual task", it may pale into comparison beside the litany of statutory instruments likely to be needed to prepare the UK for life outside the EU and which - unlike most typical secondary legislation - MPs have vowed to scrutinise in detail.
Her office is playing a key role working with lawyers across Whitehall as part of a Statutory Instrument Hub, drawing up what could be as many as 900 pieces of individual legislation.
"The secondary legislation that is to be required for Brexit is obviously going to be a significant challenge.
"They all have to be drafted. We have taken on some of the drafting, which is unusual for us, but... we can add quite a bit of value by intervening in some things."
While the Office of Parliamentary Counsel is a relatively tranquil corner of Whitehall, there has been something of a quiet revolution going on in the past decade.
Flexible working is the norm - helping to ensure a 50-50 gender balance among the team - drafting guidelines are now available for everyone to read online, amendments are tabled by the press of a button not hand delivered to Parliament, and the office - since 2015 - is run by a woman for the first time.
The mother-of-two didn't have a "burning ambition" to take the helm but is not unaware of having added another chink in Whitehall's glass ceiling.
"I am the 24th [first parliamentary counsel], and there are 23 pictures of men on the wall.
"I am proud to have got the job, but I realise that it means quite a lot to other people that there is a woman in the role.
"I don't see myself as a role model, but I have to step into that role a bit because it is important to people in the organisation that there are women in senior positions."