NEW YORK — While the rest of the country — or so it seems — is still in mourning over the tragic death of Will Gardner in last week’s episode of “The Good Wife,” at least one woman sees opportunity in his untimely passing.

As Josh Charles explained in a conversation with series creators Michelle and Robert King and co-star Julianna Margulies on Wednesday night at New York’s Ed Sullivan Theater, the reaction to his character’s demise has been touching and heartfelt — not unlike attending his own funeral.

The discussion followed a preview screening of this Sunday’s episode depicting the aftermath of Will’s death and was moderated by Charlie Rose. Here are some other things we learned:

Charles decided to leave the series because he felt "a little fried." The actor began to contemplate leaving when his contract was up for renewal last year. (As he was eager to emphasize, he was not let out of a contract.) Here's how he explained his rationale: "It coincided to the same time I was proposing to my wife. I'm now married, and I did a lot of soul searching," he said. "It's a very long season doing network television, and somewhere in year four I felt a little burned out. … I felt a little fried. And I was ready for something different. That's no reflection on how I feel about the show. It's just more about what I wanted to do in my life. … The show's meant everything to me."

You can thank Margulies for convincing Charles to return this season at all. The actress learned in March 2013 that Charles wasn't going to renew. Since the rest of the season had been mapped out at that point, writing Will out of the series in a thoughtful way would have been virtually impossible. "It kind have meant his character was just going to disappear, or someone was just going to talk about him leaving, and I couldn't accept that," Margulies said. "He's been such an integral part of the show. I felt like if this is going to happen, we're going to do it right."

So Margulies embraced her inner Alicia Florrick and called Charles to negotiate. She gave the actor what she called “terrible Jew guilt”: “I said, ‘Josh, how about this?’ Fifteen episodes, money in the bank. Do you know how expensive it is to have a baby in New York? I went right to the kid thing. It was disgusting, honestly. … We were looking into kindergarten for our son at the time, and I was like, ‘Do you know how much private school is?’ And I went into this whole thing about kids and family. And he was like, 15, let me think about that. And I said, ‘Two directing slots.’ Then I hung up.”

Once they knew Charles was leaving, the writing staff looked at George Clooney's last season on "ER" and were "slaves to 'Breaking Bad'" in order to plot Will's exit. But the tricky part is that, unlike "Breaking Bad," "The Good Wife" has to fill a 22-episode season.

So the Kings decided to trick the audience into thinking "Willicia" would reunite at the end of Season 5. As Robert King explained, the show structures each season around two pivotal events. The first big story this year was Alicia leaving to start her own firm in Episode 5, creating a rift with Will. The Kings knew that the second major event of the season would be his death but threw viewers off the scent by planting the seeds for a reconciliation between the characters. "One of the things we played to was the audience's expectation of a character arc. We want the sense that Alicia and Will, the arc of the year was that they were going to get back together," Robert King said. "The magician thinks in terms of what he wants the audience to think, but we knew really the undercurrent is that Will was going to die, and the second half of the year is dealing with Alicia's dismay about her life, her career." How cruel!

The writers and critics agree: This has been a banner season for "The Good Wife." Asked whether the show has been especially good this season, as is the overwhelming consensus among TV critics, Michelle King agreed. "I think this has been a little bit of a special season, perhaps because we were taking bigger chances. The splitting up of the firm, losing Will — those were bigger moves than we've ever attempted in the past." It also helped that CBS Entertainment chairman Nina Tassler gave the Kings the go-ahead to write episodes that didn't involve a case of the week — a big allowance for the procedural-loving network.

If you're really upset about Will, just let Charles know on Twitter. He might even call to console you. Last Sunday night, Charles was in the editing room working on an upcoming episode of "The Good Wife" he directed. As the reaction to his character's death lit up the Internet, he got a message from a Twitter friend whose mother was completely overcome with grief at the news. So Charles did what surely any major network TV star would do: He called her. "We had a really nice chat," he said. "She was devastated, but I talked her through it."