Jed Mercurio has said that he tries to keep things flexible when writing Line Of Duty and waits until a new season is coming together to start casting.
The writer, 55, detailed how the hit police drama, which saw 12.8million people tune in for the series six finale last Sunday, is created in a new interview.
He told The Sun: 'We don't plan ahead to the extent that we can book an actor to be in the following season or the season after.
'It's only when we are in the process of constructing the season that we're working on that we might then start that conversation.
'So, we would explore whether a particular actor is available to serve a certain storyline and if we are lucky enough that they are, we can go ahead and include that storyline.'
Jed then added that if the star is busy or their diary means they can't commit to filming dates, then he and the team will have to think of 'alternative' options.
The insight comes after Jed revealed there was a major clue that Ian Buckells was H back in Line Of Duty's first ever season.
The series creator detailed how he dropped a sign the officer (Nigel Boyle) was bent in 2012 after he allowed the caddy Dot Cottan (Craig Parkinson) to speak with criminal Tommy Hunter (Brian McCardie) alone in the back of a van.
And explaining why he made bumbling Buckells the fourth man, Jed explained that it was 'really important' that H ended up being someone involved from the start.
Jed told the Obsessed With Line of Duty podcast: 'It was always really important to me that it was someone who had been in season one, someone who had been there the whole time.
'We did introduce some characters late, so Thurwell came in late, we went back to Fairbank, who'd appeared in season three, we had the Chief Constable, who had obviously been there since season one.
'But then I don't think he would have been a satisfying candidate because he had been absent for so long, it would feel like we'd just brought him back in to pin it on him.'
Jed then revealed the clue he'd written into the script, which should have tipped eagle-eyed fans off about Buckells right from the offset.
He said: 'It was really about the heritage of the series, going all the way back to season one, where Dot Cottan says, 'Oh, can I just have a quick word with Tommy Hunter in the back of the van?' and Buckells goes, 'Yeah, alright'.
'OK, like, really, is that what you should be doing? Of course, not.'
Jed continued that Buckells being seen as a bit useless and bumbling ended up being written into the script to the officer's advantage.
According to Entertainment Daily, he said: 'So you think he's just a bit rubbish and so he doesn't care. And that ended up being part of the evolution of the character..'
Series one of Line Of Duty saw AC-12 investigate DCI Tony Gates (Lennie James) and Jackie Laverty (Gina McKee) is also introduced, with her becoming a key character in following seasons as her body is stored in Terry Boyle's fridge.
And as H was finally revealed on Sunday night's long-awaited Line Of Duty finale, many shocked fans realised they'd been looking at the mastermind the entire time.
As eagle-eyed fans learned that Superintendent Buckells was the famous fourth man, having liased with the OCG to bring down officers who failed to do their bidding, more clues from past seasons of the show came to light.
Now that it has been revealed, clues from past seasons have been exposed, including bad spelling, a repeated catchphrase and even a hint from Nigel Boyle - the man behind Buckells - as a warning that he was 'one to watch'.
Mugging them off
A very telling yet subtle clue came back in 2017 when Buckells seemed to first reveal his vendetta against AC-12, when he first used the word mug.
During a grilling in series four, Buckells locked horns with Ted Hastings, played by Adrian Dunbar, and stated: 'You lot treat everyone like mugs. Who's the mug now?'
Fast forward five years and on Sunday night's big reveal, at the conclusion of his interrogation, Buckells stated: 'I'm a blundering fool? I'm only the one who's made total mugs out of you lot'- harking back to his original quip.
In typical Hastings style, he hit back just as hard, as he simply stated: 'No-one makes mugs of AC-12'.
The original 'mug line' came when Buckells appeared as a replacement for Thandiwe Newton's character DCI Roz Huntley when she was removed as Operation Trapdoor head.
The Fourth Man-to-be saw Vicky McClure's DS Kate Fleming on the squad, having encountered her in his first in the first season, where he worked out that she was working undercover for the anti-corruption squad.
When Ted learned he had clocked Kate, he covertly met with the villain to instruct him not to blow her cover - something her agreed to with clear chagrin and even refused to help further their investigation as he was 'no grass'.
When Kate was uncovered, he remained insistent that he did not blow her cover but also made it very clear he had nothing but dislike for AC-12.
Ted then had a heated exchange with Buckells, who was dismissed - not before sneering his now iconic line: 'You lot treat everyone like mugs. Who's the mug now?'
Another mug-based red herring came when fans were convinced earlier this month that home decor - tying in with the mug detail - was the answer to H's identity.
The theory involved John Corbett's widow Steph, when fans noticed an intricate 'clue' hidden in her kitchen tiles. Fans were convinced that the 'H' pattern in Steph's tiles was a link to the man AC-12 have been hunting for the past six series.
And while some dismissed the speculation as wild, it seems it was in fact a true illustration due to the presence of the poignant 'mug' line.
The mistake that DEFINATELY gave him away
The biggest giveaway for Buckells turned out to be the word 'definately', with his repeated spelling gaffe turning fingers his way.
When Ted and his team saw exchanges between the OCG and Jo Davidson featuring the word misspelt on a number of occasions, he demanded the archives were sifted through in the hunt of the mistake again.
The trawl then revealed the same error in 2019, in communications between the OCG and Lisa McQueen, in the same year in Operation Lighthouse and again in the Lawerence Christopher inquiry in 2003.
This quickly left fingers firmly pointed towards Buckells.
2021
Line Of Duty finale, May 2 (BBC One) 12.8 million
Prince Philip's funeral, April 17 (ITV & BBC One) 13.6 million
Harry and Meghan with Oprah Winfrey, March 8 (ITV) 11.7 million
2020
Boris Johnson lockdown announcement, March 23 (BBC One) 14.5 million
Queen's address to the nation, April 5 (BBC One) 14 million
Boris Johnson's second address to the nation, May 10 (BBC One) 18.7 million
I'm A Celebrity Get Me Out Of Here!, November 15 (ITV) 12.1 million
2019
Gavin And Stacey Christmas special (BBC One) 17.1 million viewers
2012
Closing ceremony of the London 2012 Olympic Games (BBC One) 24.5 million
2010
The X Factor (ITV) 17.7 million
1995
Princess Diana interview with Martin Bashir (BBC One) 23 million
1966
The 1966 World Cup final (BBC and ITV joint broadcast) 32.3 million viewers
A hole in one
Earlier in the series, viewers saw a set of golf clubs in Hillsgate police station and noted that the clubs have strong significance.
Harking back to villain Matthew 'Dot' Cottan and his nickname 'The Caddy', fans then recalled his death in series three and once Buckells' clubs were spotted, began to close in on the villain.
Taking to Twitter, fans workout the possible play on words, writing: 'Didn't know Buckles plays golf? H Caddy.'
'Always called in on ops involving bent coppers. HAS GOLF CLUBS IN HIS OFFICE.'
A third tweeted: 'Golf clubs in buckles' office? golf = caddy.'
A BIG (Mac) clue
In another seeming early nod to his vendetta, fans pointed out that from the very start of the show he showed his dodgy side when he promised Ryan Pilkington a Big Mac while grilling the young criminal.
As we learnt along the way that Ryan was rotten to the core - having started his criminal career as a delivery boy for drugs and burner phones on his bike, and even attempting to cut off Steve Arnott's fingers, he appeared to have a fleeting affinity with Buckells.
Several fans had also clocked onto his unusual behaviour hinting that he was corrupt from the start.
Back in October, a Reddit user relaid the theory, writing: 'I was rewatching all the episodes when I noticed something weird in the series one finale. As we know Kate interviewed Ryan about Steve's torture. Straight after that Buckells Comes in he seems worried.
'After Buckells sits down with Ryan, Ryan says 'can I have my Big Mac now?' I think Buckells may have bribed him with it. I know it sounds stupid but if Ryan was poor and living in a rough area, then a Big Mac would be a massive deal for the kid.'
A slip of the tongue
Back in 2017, while promoting Series Four of the show, Nigel Boyle - the man behind Buckells - appeared to be throwing crumbs to fans in a big way.
In an interview with Digital Spy, he seemed to allude to what fans had to wait four more years for as he said: 'There's definitely more to Buckells than meets the eye!'
Continuing his description of the ultimate villain, he went on: 'He's very competent, very good at what he does, he's the go-to guy, but he's certainly not a popular guy – he's petulant, and a bit of a jobsworth I think...
'I don't think people give him enough credit, just because of his personality!'
Buckells hired 'baddie' Ryan Pilkington
Pilkington was killed after confessing to multiple murders on the show and met a sticky end at the hands of Kate Fleming in a fierce shoot-out.
Yet some eagle-eyed fans realised it was clear Buckells must have been aware of his real identity from the start.
When Kate can't quite place Ryan's face, he recognises him straight away, almost putting Kate to shame. He also interviewed him in the first series.
He was a little too involved in the Laverty case
Fans of the show noticed that Buckells was appointed to the Laverty case by the bent Superintendent Derek Hilton, which can't be without coincidence.
Buckells was also responsible for the paperwork mix-up which allowed the OCG to swap Terry Boyle into Carl Banks' flat at the start of the season.
It later became clear that Buckells had coaxed false testimony out of his partner Deborah Devereux which placed Terry Boyle as a suspect in the murder of Gayle Vella.
The pre-show hints
When quizzed on whether viewers will learn who the illusive 'H' is, Martin said: 'I wouldn't quite go the Jo Davidson no comment route - but what I will tell you is I think there's a lot of pay offs coming this Sunday.
'There's a lot of big answers and it's deserved, people have stuck with us for a long time, so there comes a point where the story arch comes to an end.'
Dodgy beginnings
Buckells kicked off his career as a young Detective Constable, working on the murder of Lawrence Christopher in 2013 with former Inspector Philip Osborne (Owen Teale) and DCI Marcus Thurwell (Jimmy Nesbitt).
Despite it being a racially motivated attack, the team concluded that it was gang-related, failed to follow up on forensic evidence and carried out the investigation slowly - providing the five suspects with the opportunity to save their heads and minimise identification.
Now-deceased Thurwell obstructed the case on purpose in a bid to help ringleader Darren Hunter - the son of kingpin Tommy Hunter.
Line of Duty fans across the nation were left underwhelmed and disappointed by the identity of mysterious antagonist 'H'.
Loyal viewers took to social media in their droves to share their frustrations as officers from the police anti-corruption unit AC-12 discovered the identity of the elusive 'fourth man'.
But the revelation the bent copper colluding with the organised crime groups (OCGs), was actually DSI Ian Buckells infuriated many seasoned Line Of Duty fans.
It saw the words 'fuming', 'disappointing' and 'underwhelming' all trend on social media in the aftermath of the show.
And the disbelief it could be him was compounded by the way he was only caught because of his repeated mis-spelling of the word 'definitely' - hardly the blunder of a hardened criminal mastermind.
The detective - widely thought until last night to have been just a bungling stooge - was first introduced to viewers in series one as the SIO in the case of murdered businesswoman Jackie Laverty by then Chief Superintendent Derek Hilton.
He later went on to become Detective Chief Inspector in series four before being promoted once more to Detective Superintendent in this final series.
Sharing their disappointment on the revelation, one disgruntled Line of Duty fan wrote on Twitter: 'Can't believe I watched six seasons of line of Duty for Ian Buckells, the most pointless character to be the fourth man. Fuming.'
While another viewer added: 'Buckells, the most pointless character'.