After 25 mediocre years, The One I Love and its ilk are reinventing the genre.

The romantic comedy is dead. We all agree on that, right? Twenty-five years after Harry met Sally, the genre they established—in its contemporary Hollywood form—is moribund. Every few months, someone eagerly analyzes the evolution and apparent decline of the genre. As evidence, he or she points to waning box office returns for the kind of film that used to draw people in droves—as Runaway Bride ($152 million), 50 First Dates ($120 million), and Sweet Home Alabama ($127 million), to take just a few unremarkable examples from roughly 10 to 15 years ago, each did. The reason today’s crop of similarly tailored rom-coms don’t earn like they used to, they say, is that the big stars of the era (Julia Roberts, Drew Barrymore, Reese Witherspoon) have aged out of the single-woman-looking-for-love category, and the movies have gotten plain awful.

But the cold, hard truth is that the straight-up rom-coms of the last quarter-century have almost all been bad. The genre as we have come to know it is simply not built to produce anything close to a masterpiece. In fact, it’s meant to churn out knockoffs of When Harry Met Sally. And maybe now that the by-the-book template for the rom-com is commercially kaput, the ideaof the romantic comedy can once again be reborn—in a form a little different than what we have lately envisioned it to be.

Look no further thanThe One I Love, out Friday in theaters but viewable on demand for the past few weeks. Starring Elisabeth Moss and Mark Duplass as a married couple hoping to reconnect over a long weekend getaway, Charlie McDowell’s bizarre film is unlike the rom-coms that typically litter America’s multiplexes in the traditional cinematic wastelands of February and August. As the New York Times noted, it’s one of a smattering of indies that are creating “a new breed of romantic comedy.” To resurrect the “troubled” genre, Brooks Barnes wrote in that paper, “a smattering of aspiring young directors and writers are taking the form and tinkering, twisting and turning it inside out to instill freshness.”

When you pack all of these tired tropes into a single movie, that movie is almost always bad. When Harry Met Sally remains much better than its imitators—even if it lacks the bite of the movie it less slavishly imitated, Annie Hall—and it contains all of these tropes. But it’s left some truly awful and formulaic films in its wake: From the Nora Ephron–directed You’ve Got Mailto Runaway Brideto Friends With Benefits to pretty much anything starring Katherine Heigl or Kate Hudson or even Jennifer Aniston. What worked for Harry and Sally has been bastardized time and again by filmmakers following the template too closely while forgetting to imbue their characters and their stories with any original fire or unexpected chemistry.

And I get it: Hollywood is the land of formula. The structure of the rom-com worked once, and then a few more times, and nervous development executives probably figured that aping it again and again was a safe way to go in a confusing marketplace. But by avoiding rom-com clichés, The One I Love delivers the sharp laughs and emotional oomph that rom-coms were always supposed to—that Harry and Sally did—without adhering to a formula at all. Instead, the film goes deep in its deconstruction of the genre with a premise that leans on tropes from other kinds of films—in addition to the kind that it interestingly and unconventionally is.

To explain how it does so, I need to spoil a few things. If you read on without seeing the movie first, consider yourself warned.

The film opens not with a meet-cute, but with a couple at the end of its tether. Ethan and Sophie are talking with their therapist (Ted Danson) about their relationship. The spark they once shared is gone. “I used to call her a bitch and she thought it was funny,” Ethan tells the therapist, matter-of-factly. Sophie says she used to call Ethan an asshole and that was amusing once, too. Neither of them is happy.

The therapist suggests they spend a weekend at a house in the country, and that’s when things get weird. The guesthouse next door, it seems, contains a sort of parallel universe where a doppelgänger of each of them resides for the other to enjoy. Whenever Ethan enters the guesthouse, another, nearly identical Sophie is there, and she is ever so slightly different—more agreeable, more laid-back, happy to cook her husband bacon (real Sophie hates it when he eats bacon). And whenever Sophie enters the guesthouse, the Ethan she finds is also more relaxed, but also more fitness-conscious, minus nerdy glasses and plus “beach-y” hair.

This entire setup has a wonderfully Rod Serling vibe to it, as a baffled Ethan at one point suggests. (The “Mirror Image” episode of The Twilight Zone feels particularly relevant.) Ethan is reluctant to play around in this weird new world, but Sophie seems, if anything, a little too eager to keep seeing faux-Ethan—and this creates some unnerving, revealing tension within the couple’s already fraught relationship.

There are a couple of elements at the heart of The One I Love that can be classified as conventionally rom-com. There’s a will-they-or-won’t-they question driving the narrative, as the two alternate alone-time with their “ideal” counterparts—eventually having an uncomfortable double-date dinner. There’s even a grand romantic gesture at the climax, in high rom-com style.

But The One I Love dispenses with the obvious ways of delivering traditional rom-com beats. The will-they-or-won’t-they is built around whether Ethan and Sophie can revive happier times, not whether their union will end in marriage. (In this way it harkens back to the so-called comedies of remarriage from the screwball era, which focused on couples getting back together, rather than uniting for the first time.) The grand romantic gesture involves real Ethan tussling with faux Ethan over real Sophie. And without a Greek chorus of “best friends” and potential outside paramours who are mere temporary roadblocks on the path to a most perfect union (the only other actor who gets dialogue is Danson), everything that threatens their relationship comes from within (so long as you think of those doppelgängers as, in some sense, internal threats).

The guesthouse and its odd residents come to represent what many people in a long-term relationship eventually begin dreaming about: something new, something different from the partners they already have. The guesthouse tests the waters of an open relationship, with a mystical twist. Ethan and Sophie get to spend time with idealized versions of the other, ones who seem attentive to their every want and desire. For Sophie, this is enough, and she knowingly cheats on Ethan with faux Ethan. But Ethan, who’s already cheated in the past, wants to be with the woman he actually married. “I don’t wanna be perfect,” he pleads with real Sophie. “I wanna be us.”

It’s not only Justin Lader’s clever script or McDowell’s assured directing that makes The One I Love a superior rom-com. Much credit is due also to Moss and Duplass, whose relationship is believable from beginning to end.Similar things can be said of Her,Enough Said,Obvious Child, and earlier movies like Eternal Sunshine of the Spotless Mind and Punch Drunk Love, all filmsthat, like The One I Love, possess rom-com elements but don’t collapse under the weight of them. These films aren’t always readily classified as rom-coms, because on the surface they don’t look like 27 Dresses or The Best Man. But they are. (Notably, three of these movies draw on sci-fi or the supernatural for their genre-rejuvenating twists.)

A couple of weeks ago, Ramin Setoodeh argued in Variety that “Hollywood Shouldn’t Give Up on the Romantic Comedy,” suggesting a “reboot” of the genre while blaming bromances like 22 Jump StreetandNeighborsfor stealing attention away from films aimed at women. But the rom-com is already in the midst of a reboot. After years of having exactly what Harry and Sally were having, with increasingly diminishing returns, rom-coms, thankfully, seem to be having it their own way.