Warning: Spoilers ahead for How I Met Your Father season 1!

While it would have been easy for How I Met Your Father’s Meredith plot to rely on a lazy screenwriting trope, the How I Met Your Mother spinoff took the character in a much less predictable direction. The "terrible ex" is such a pervasive sitcom staple that shows like Crazy Ex-Girlfriend have been built around subverting the stereotype. From Friends to How I Met Your Mother, many hang-out sitcoms have relied on the stock character for years.

Typically, the ex in question is female and is either narcissistic, self-centered, a compulsive liar, insufferably boring, a cheater, or just generally awful. This prompts the show’s heroes to wonder why their friend ended up with this character in the first place, a logical quandary these sitcoms rarely bother to address. However, How I Met Your Father used a cameo from Leighton Meester as Jesse’s ex Meredith to challenge and deconstruct this cliche.

Related: HIMYF Just Avoided Recreating One of HIMYM’s Best Loved Locations

Viewers did not see a lot of Meester’s Meredith in How I Met Your Father season 1, but in her few appearances, the character was surprisingly reasonable and agreeable. It would be easy, given her musical career success in comparison to her former love interest Jesse, to make her a conniving, conceited figure, but the twist works better this way since viewers can understand why Jesses would want to get back together with her, and why they worked as a couple in the first place). While many fans could be sad to see the show’s heroine Sophie miss her chance at romance with Jesse in the How I Met Your Mother spinoff's season 1 finale, the character’s impetus for reuniting with Meredith is easy for viewers to understand.

Meredith and Jesse kiss in the HIMYF Finale

Usually, the toxic ex is not provided with a lot of depth, and while the sitcom’s hero may still idealize them, they are depicted as being ill-mannered and thoughtless by the series itself. However, Meester’s Meredith subverted these expectations when a How I Met Your Father episode saw her seek out Jesse to deliver the news that she signed a recording contract in person. It was a thoughtful gesture that softened the blow to her ex’s ego and one that made Meredith a surprisingly sympathetic figure. The fact that Meester’s character then expressed a clear interest in reuniting with Jesse gave her a leg up on How I Met Your Father’s heroine Sophie who, unlike How I Met Your Mother hero Ted, was too afraid of commitment to pursue a relationship with him.

Thus, while Sophie losing Jesse to Meredith could have been a cliched case of the evil ex stealing the hero away, the twist instead felt atypically fresh. How I Met Your Father showed that it was Sophie’s inability to commit that jeopardized her chances with Jesse, rather than blaming Meredith. Moreover, How I Met Your Father depicted Meredith as a believable human rather than a caricature. Of course, this only made the ending all the more devastating for fans of Jesse and Sophie’s How I Met Your Father relationship, but it also proved that the How I Met Your Mother spinoff was more than capable of surprising fans by avoiding cliched character dynamics.

More: How I Met Your Father Nails One Story HIMYM Always Avoided