A lot has changed in the two years since Tom Perrotta first published “Mrs. Fletcher.”

The novel centers on the titular Eve Fletcher, whose son goes off to college, granting her the opportunity to explore her sexuality and new-found freedom through pornography, higher education and new relationships. At the time he was writing the novel, Perrotta tells Variety, he remembers feeling a “bubbling underneath the surface of the culture that sex and gender were really in flux, and there was just a lot of volatile energy around these subjects.” He also recalls a lot of “middle-aged, middle class people [were] coming into contact with these new ideas” at the time, which further made the themes ripe for storytelling.

But in a post-#MeToo, Time’s Up era, Perrotta acknowledges, the conversations had around sexuality are very different. Therefore, when he was adapting the book into a HBO limited series, he knew certain key changes had to be made to reflect how “the things that were under the surface had exploded and were right on the surface.”

This became integral to how Perrotta unpacked Eve’s (played by Kathryn Hahn) journey, Most notably, he says, he changed the class Eve takes from one about gender in society (in the book) to one that is a personal essay class in the show. “In the book, Eve’s class with Margo functions almost as Gender Studies 101, and there’s a lot of material that reflects conversations that I was hearing five years ago, rather than what people are talking about in this moment,” he explains. “We were trying to keep up with a fast-moving culture.”

In a similar vein, Perrotta altered plans for Eve’s son Brendan (played by Jackson White), as well as his roommate (played by Cameron Boyce). In the book, Brendan, a popular high school jock, goes to college and has a roommate who seemed to be just like him but “undergoes an evolution that Brendan just lags behind on, so it’s almost like we’re seeing a better version of Brendan,” Perrotta points out. When he started up his writers’ room for the adaptation, though, Perrotta admits that such a story “didn’t seem as interesting to the room as the idea that he has a roommate that’s very different from him and poses a more direct challenge.”

Although some of the specifics of the story changed, Perrotta says the reason he wanted to adapt the characters’ journeys from the book, rather than extend them into new places with a follow-up tale or just write a completely new story was because he had faith that the story and themes “didn’t have an expiration date on it.

“The core of the story of a mom trying to find happiness and using porn to expand her sense of what is possible didn’t seem affected by the changes that happened in the past five years,” he says.

So, he just tried to “set up a room where the book wasn’t taken to be the ultimate authority,” he continues. “We could change, we could invent.”

Perrotta is no stranger to adapting his own novels for on-screen works — in fact, he shares he first began writing “Mrs. Fletcher” as a novel while working on his previous HBO adaptation “The Leftovers” with Damon Lindelof. But this experience provided him some crucial new kinds of collaborations, including with performers Hahn and Jen Richards, who plays Margo.

Richards had previously voiced part of the audiobook version of “Mrs. Fletcher,” and Perrotta notes that she “knew the character intimately” from that experience. But more importantly, being transgender also allowed Richards to “bring her own life experiences into the discussion in a way that I can’t.”

Collaborating with female directors also became a must for “Mrs. Fletcher,” according to Perrotta.

“This is another case where those years were so culturally decisive. I think they really made everybody stop and examine who is telling a story, who has the right to tell a story. It wasn’t something that really occurred to me; I had been writing many characters for 20 years and had a female audience that really liked the characters. When I started writing the book, I didn’t think, ‘Oh someone might not think I should do this,’ but then suddenly it became very politicized — for good reason. So it was something that Amy Gravitt, the executive at HBO, and I, when we first met, both just completely agreed on: that this story needed to have a lot of really strong women’s voices; it couldn’t just be this middle aged guy telling this woman’s story,” he explains.

“Given the intimacy of each story and that kind of very bold and unguarded way that Kathryn portrays [Eve], I think it just really helped for her to feel like she had women directors who she felt she had a close bond with and could really trust.”

“Mrs. Fletcher” premieres Oct. 27 on HBO.