Don’t take them the wrong way. Husband-and-wife team Tony Phelan and Joan Rater loved their time working on ABC’s long-running Grey’s Anatomy. It’s just that in their downtime, they’re both self-professed true-crime addicts, and an established medical drama is not the best vehicle for telling the sort of ripped-from-the-headlines stories they love to read.

Which, as much as anything else, accounts for their creating the new CBS legal drama Doubt, premiering Wednesday on CBS.

“We’re news junkies and law junkies as well,” says Phelan tells The Hollywood Reporter. “After nine years in the world of a medical series, it’s kind of a welcome relief to now be looking for the sort of stories to tell that we’d be reading about anyway.”

The way they see it, going from doctors to lawyers isn’t that big a leap. Rater figures that “the stakes for the characters on Grey’s were so high, literally life and death. But that’s kind of the same for characters in a legal show.” Thanks to all the true-life tales she and Phelan have read, they've become convinced that “our criminal justice system is flawed and needs reform.”

This show is their chance to point out some of those flaws.

Doubt focuses on Sadie Ellis (Katherine Heigl), a successful lawyer who finds herself falling for a charismatic client accused of murder (Steven Pasquale). Meanwhile, her fellow attorneys (Elliot Gould, Dule Hill, Laverne Cox and Dreama Walker) are busy defending their own quirky clients.

The closest Phelan and Rater have ever come to a  TV courtroom, other than devouring any and all true-crime news, was their short stint writing on Law & Order: Trial By Jury. To ensure their series would reflect what’s really happening in the criminal justice world, they spent months meeting with experienced defense attorneys.

“Our experience was that they are largely a gregarious group and love to spill their stories,” says Phelan. Adds Rater: “You can do all the reading about a topic that you want, but it’s the people with their boots on the ground who have the nuance and details you couldn’t possibly glean on your own. Their little stories and details ended up being jumping off points for us.”

They’d taken a similar approach during their time on Grey’s, surgically pulling personal tales from medical professionals including Rater's mother (a nurse) and father (a doctor). “They were great but did tell us at one point that in their 25 years in the medical world, they’d never had sex in a supply closet,” she jokes. With Doubt, they’ve gone one step further by making sure their actors also do their research.

In particular, they handed out copies of the book How Can You Defend Those People: The Making of a Criminal Lawyer. They also invited a defense attorney to come in and talk to the cast. The conversation apparently struck a chord with the actors, as they heard how hard it is to go home at night or take a vacation knowing that a client is sitting in jail.

“What has surprised me most from these personal testaments and from what we’ve read in straightforward criminal justice books is how little things have changed in the system,” says Phelan. “There are so many vested interests in keeping things frozen so making a difference is really, really hard. Change takes political will and funding and a real demand for justice. For instance, I learned about a guy in New York City who had been held without bail for two years. What’s happening is terrifying, almost like it’s Crime And Punishment out there.”

As a counterpoint to this bleakness, he and Rater want their series to celebrate the passion and empathy of criminal defense attorneys. They also want it to seem as real as possible, not only when it comes to the stories they tell but the actors they hire to tell them. Which is why they were happy to work again with Heigl after spending several years working together on Grey’s.

“She’s remarkable,” explains Phelan. “The Sadie character requires the ability to be funny, yet serious, yet smart, yet relatable. When she read the pilot script for us the very first time, she said, ‘I know exactly who this woman is. I can hear her voice.'"

This came as welcome news to Phelan and Rater, who already had shot another version of the pilot in 2015 with KaDee Strickland in the lead role. CBS asked them to retool it and when Heigl became available, they jumped on the chance to work with her.

“The fact that Joan and Tony were a part of this show got my attention because I knew how smart and amazing their work is,” says Heigl. “The biggest moment for me was meeting with them before I came on and realizing how clever and thoughtful and truly unique their ideas were for this new show. Then, when I read the pilot, I was blown away by the character, the premise and the story outline for the season. This character is someone I respect and admire.”

In particular, Heigl was taken by Sadie’s “fantastic, complicated backstory and sense of humor and vulnerability.” And even though the character wasn’t written specifically for her, Sadie is “someone familiar and somebody whose skin I definitely feel I can get under.”

Heigl and the ripped-from-headlines plot points aren’t the only elements of Doubt that the creators hope will ground their show in reality. There’s also Laverne Cox, who co-stars as Heigl’s fellow attorney, Cameron Wirth. Not only is the character of a successful trans woman being played by a successful trans woman, she’s also inspired by someone in Phelan and Rater’s life – their son Tom, a trans man.

“The issue of being a trans person in America today is very much a part of our lives,” explains Phelan. “And it was important for us to show that but at the same time we wanted to make sure that element of her life wasn’t the defining part of Cameron." Adds Rater, “There’s a lot of excitement in the trans community about Laverne being in our show and there is a desire to see her character to be all kinds of things we have yet to see on TV.”

As it turned out, Cox was well aware of their son, even though she didn’t realize it when she met with the married duo for her screen test.

“Then I realized Tom Phelan was the actor I’d sent a tweet to a year before, when he got a recurring role on The Fosters,” recalls Cox. “I always want to support trans actors so I sent him my congratulations. And it turns out that now he’s the son of my bosses! I met him in person while we were shooting the pilot, and the most compelling thing Joan said to me at the time was, ‘Tom is trans and is so many other things too, so we wanted to write a trans character who is so many other things.’”

Once Cox was officially on board, she also met with the Doubt writers. As they did with all her co-stars, they grilled her for personal stories that might make their way into the scripts. They already had toyed with the idea of giving Cameron a story arc about her dating life. As someone who “has always been very candid about my dating,” Cox spoke about her struggles going out with “guys attracted to trans women but don’t want to let people know.” The result is a feeling of shame on both sides.

“We talked at length about that issue,” explains Rater. “So we have this great romantic love story for Laverne that we’re excited for people to see.”

Being the first primetime network series featuring a trans character played by a trans actor sets Doubt apart from the competition. Phelan and Rater have high hopes viewers also will appreciate some of the other ways their series breathes new life into legal dramas, just as Grey’s Anatomy did for medical shows.

Grey’s gave us the opportunity into a dialogue with our audience about the important issues of the day,” says Phelan. “But Doubt feels even more immediate because the issues we're tackling relate to right and wrong and the compromises we all make in life on a daily basis.”

And, explains Rater, “we don’t have this thing where we need to decide what kind of surgery will be in Act Four.”

Doubt premieres Wednesday at 10 p.m. on CBS.