Last month Doctor Who cleared up one of the show's most enduring mysteries: why does the Twelfth Doctor look exactly like Caecilius, the friendly Roman rescued by David Tennant’s Doctor in 2008 adventure The Fires of Pompeii? According to The Girl Who Died, the Time Lord used Caecilius’ face as a reminder to always try to save people, no matter what the consequences, just as he did in that episode.

Stirring stuff, but it still didn't settle the question of Peter Capaldi's other appearance in the Doctor Who universe, as John Frobisher, a civil servant in 2009’s Torchwood: Children of Earth.

Well, now Steven Moffat has explained that too – and all with the help of former showrunner Russell T Davies.

Speaking at the Doctor Who Festival, Moffat explained that, "When I first cast Peter Capaldi as the Doctor I remembered that Russell had said to me that he had a plan to account for the fact that Capaldi turns up in both Doctor Who and Torchwood in different parts. So I wrote to him to ask, 'look, what's the plan? And does it fit?' He said, 'yes! I've worked it out!'

"He said that it's about – as the Doctor says – asserting his right to save people. His plan was that in the Torchwood episode – which we couldn't really reference as it would have been difficult in that scene – is that the Doctor asserts himself over time by saving Capaldi's character in The Fires of Pompeii and time re-asserts itself by ending that bloodline in the Torchwood episode [when Frobisher finds himself in a situation that forces him into suicide]. And the Doctor says, 'to hell with you time!' And takes that face and brings it back again. It's the Doctor's eternal battle with doom and destiny."

But wait, if time has corrected Caecilius' bloodline, does that means that Caecilius and John Frobisher are related? 

"Yes," said Moffat. "And remarkably there's a level of genetic throwback in that thousand years to make them identical!"

So there we go – mystery solved!