SPOILER ALERT: Do not read if you have not yet watched the first three episodes of “Castle Rock” Season 2, streaming now on Hulu.

When “Castle Rock” co-creators and executive producers Dusty Thomason and Sam Shaw were first researching Maine to develop their Hulu anthology series based on the world of Stephen King, something that stood out to them were the Somali immigrant communities that resettled in small towns in the New England state. The rich story area of a group of refugees turning around dying towns never made it into the first season of the show, but it is an integral part of the second.

“You had the whitest state in America welcoming in, and sometimes not welcoming in, this group of immigrants,” Thomason tells Variety.

That idea of whether or not strangers are welcome in a tight-knit community is further explored in Season 2 of “Castle Rock” through the origin story of classic King character Annie Wilkes (played in “Castle Rock” by Lizzy Caplan). Annie is introduced as someone who has spent years of moving around the country with her daughter (Elsie Fisher) but finds herself settling down in Maine.

“At some level Annie, herself, is a person without a home — a person who had been searching for a home for a long time,” Thomason says. “Episode 1 is about searchers and settlers and this idea of, what is a home and how does one find a home on the heels of an incredibly difficult situation — in one case a geopolitical disaster that the United States got itself embroiled in and on the other a very personal story for a young girl?”

In order to tell these stories to the fullest effect, Thomason says he had to set the story in present day, despite that altering the timeline of Annie Wilkes’ story from King’s 1987 novel “Misery,” or the subsequent film of the same name.

“One of the defining characteristics I think of Annie is that she feels like a woman out of her time; she feels sometimes like a very traditional, very proper woman — on the face of it, at least. And the things she loves are antiquated. But if you’re going to have a character like that, why bring them back into another era that is also antiquated?” Thomason says. “And for the immigrant story, that would really only be possible after 1994 or 1995.”

The two pieces to the story start separately: By the time Annie arrives in Castle Rock, Pop (Tim Robbins) has already taken a number of the Somali refugees under his wing, and for a couple, quite literally into his home. But soon enough they converge, as Annie unknowingly lights a fire under the race war when she points a finger at Abdi (Barkhad Abdi) for a crime she actually committed.

“Annie is a very terrestrial antihero-slash-villain that we are turning her into this season. Part of what I wanted the audience to be able to understand was that while she is obviously complicated and obviously struggling with her own demons, that struggle is really deeply emeshed in the supernatural elements,” Thomason says.

Since Annie self-medicates for a self-diagnosed mental illness, she does not always trust what she is seeing or experiencing. So when the man she killed just casually reappears in front of her, she begins to doubt what she actually may have done to him. However, Thomason points out that although Annie can’t trust what she is seeing, the audience can trust what it is seeing in a more omniscient way than the story’s unreliable narrator.

“The supernatural element is less ambiguous than it was in Season 1. In Season 1 there was a real growing sense of unease about not really knowing what was supernatural and what wasn’t, and I think that in this season, we’re embracing a bit more of the tradition of Stephen King novels that tell you what the supernatural constructs are right from the get-go,” Thomason says.

The second season of “Castle Rock” also expands beyond the titular town to explore the neighboring area of Jerusalem’s Lot, another notorious hotbed for “dark history” in the King universe, notes Thomason. In King’s writing, which includes the 1975 novel “Salem’s Lot,” as well as a couple of subsequent short stories, that town’s troubles centers on an abandoned house that has caused trouble for its inhabitants throughout generations. The house is integral to the second season of “Castle Rock,” in “keeping the spirit” of that part of King’s world alive in the show.

Annie, though, will have to catch up to knowledge about the town’s otherworldly baggage. “What happens when you put someone who is struggling with their own issues in circumstances where the world seems to be telling them that they’re crazy? It’s a perfect storm for Annie,” Thomason says.

“Castle Rock” Season 2 streams new episodes Wednesdays on Hulu.