During the early writing stages of the show, Moffat and Gatiss didn't want to include any regular character that Conan-Doyle hadn't created. Which makes Molly the exception to Rule Number One. But the advancement of Molly's character has been a huge plus for the show; the poor girl trying to ask a man out on a date in 'A Study in Pink' moved on in 'The Reichenbach Fall', understanding what she meant to Sherlock better than he did, and Series 3 has seen her grow up completely, to become a three-dimensional character and even one of the voices in Sherlock's head. It's a similar story with Mary, a character that could have so easily been a stay-at-home wife for John to return to, a flat-out villain to unmask, or another jealous girlfriend fighting for John's attention with Sherlock. Both Molly and Mary are intelligent and important female characters that don't feel like plot devices in the slightest, despite how often they're used to develop the story and keep it moving. It would be so easy to focus completely on Freeman and Cumberbatch, giving them cardboard cut-out characters to play off against, but the writers have been cleverer than that.