Every week, we pick a new episode of the week. It could be good. It could be bad. It will always be interesting. You can read the archives here. The episode of the week for February 26 through March 2 is “He Said, She Said,” the eighth episode of Brooklyn Nine-Nine’s sixth season.

It is in the nature of TV comedies to become meaner as they get older. The longer a show runs, the more its jokes start to trend toward the characters picking on each other. What felt like affectionate teasing in earlier seasons becomes more and more vicious as it gets harder and harder to make viewers laugh.

Here’s a case in point: Jerry from Parks & Recreation. The joke about Jerry was always that the staff of the Pawnee Parks & Recreation department treated him poorly, that he was the butt of every office joke, and the show counterbalanced his difficult work life by giving him the greatest home life imaginable. (He was married to a character played by Christie Brinkley!)

But by the time Parks got to its last couple of seasons, the abuse that Jerry’s coworkers heaped on him increasingly beggared belief. They were so mean to him and so dismissive of him that if you thought about the show from his perspective for even one second, it was much, much tougher to take.

Not every sitcom becomes meaner as it gets older, but a lot of them do. It’s simply the path of least resistance. It’s hard to tell a joke that doesn’t have someone to be its butt, and it’s even harder to keep coming up with funny, fresh jokes season after season. And all along, the idea that you could just make fun of somebody is right there, an easy button to push that usually will garner laughs.

Couple this with how easy it is to get laughs by targeting those who are different in some way — by making a big, easy fat joke at the expense of an overweight guest star, for example, or doing a storyline about one of the characters being attracted to a trans woman. (How I Met Your Mother, a show I loved for many years, was one of the worst for this style of humor.) It’s why so many comedies tilt, in their later years, toward lame, would-be “edgy” humor at the expense of others.

So here’s what’s a little bit weird about NBC’s Brooklyn Nine-Nine: The longer it runs, the nicer it gets.

“He Said, She Said” is a somewhat awkward, always earnest attempt to grapple with the differences in how society treats men versus women

“He Said, She Said,” the latest episode of Brooklyn Nine-Nine, is a good case in point. It is a very earnest look at the #MeToo movement, as Amy (Melissa Fumero) and Jake (Andy Samberg) investigate a case of sexual assault brought by a woman named Keri (played by Briga Heelan, the lead of the very funny, too-short-lived NBC series Great News) against a coworker. Her company wants to offer her a settlement; Amy convinces her not to take it.

Truth be told, talking about #MeToo isn’t as close to B99’s wheelhouse as the show might like. B99 gains much of its humor from its fast pace and snappy patter, and both of those elements are largely stripped from the episode’s most involved scenes, particularly one where Amy and Rosa (Stephanie Beatriz, who also directed) debate whether Amy was right to give the woman the advice she did.

Lang Fisher’s script tries to pepper the scene with jokes from Jake, who’s present but not sure what he should contribute to the conversation as a man. His awkward discomfort feels accurate to the experience of many men, but it also leaves the scene feeling as if B99 is trying to serve too many masters at once. It works a little better in theory than in execution, which is, ultimately, true of much of “He Said, She Said.”

But at the same time, “He Said, She Said” is a tremendously ambitious piece of television. It really wants to tell a story about how hard it can be to be alive and a woman in a world built largely for the benefit of men, while simultaneously functioning as a good-natured and funny episode of Brooklyn Nine-Nine.

The early scene setting up the episode’s central plot line underlines the inherent fraughtness of such a goal. As Captain Holt (Andre Braugher, always making a meal of any line he has the privilege to deliver) announces a case involving a man with a broken penis, the officers of the 99th Precinct place bets on just how the man broke his penis, culminating in Jake coming up with a patently ludicrous situation that involves a Bentley and a goose. But then Holt reveals that the woman broke the man’s penis, and alleges that she did so after he sexually assaulted her. Goofy jokes and serious subject matter nestle right alongside each other, sometimes uneasily, but always in tandem.

B99’s dogged insistence on remaining the same show as always, while also telling an occasionally serious story about sexual harassment and assault, creates a tension within “He Said, She Said,” but that tension speaks to the way the show keeps interrogating itself. The series might not tell this story as gracefully as possible, but it’s interested in telling this story, something that might not have been true even a couple of seasons ago.

As Alan Sepinwall points out in his recap of this episode, in the early days of the series, there were plenty of jokes about men who wouldn’t take no for an answer, or about how Jake was the kind of over-the-top action hero cop who might as well come wearing a T-shirt reading “toxic masculinity.” And for all its strengths, “He Said, She Said” definitely doesn’t put that side of the show under a microscope.

But the longer the series runs, the more it skews toward a kind of Hollywood-friendly social progressivism. It’s determined to dig into the reasons these sorts of stories are often told in certain ways, and to ask how they might be told better. It’s also committed to the idea that you can make a bunch of jokes about a broken penis and still find a way to circle back around to the idea that sexual assault is not just bad but pernicious, present in every aspect of our society.

Does Brooklyn Nine-Nine pull off everything it attempts? Nah. But it’s impressive to see the series grapple with the problem that all long-running sitcoms face — the longer you’re on the air, the harder it is to surprise viewers into laughing at your jokes — by constantly trying to introduce reasons you shouldn’t laugh at those jokes in the first place.

That makes “He Said, She Said” a curious, knotty episode of an increasingly curious and knotty TV show. But it also means that the episode ends with a surprisingly optimistic call to arms, a gentle insistence that if we let women tell their stories and believe them when they do, we might find those stories are just as compelling as the old, threadbare ones we’ve been telling for too long. It’s easy to get laughs by being mean. It’s not easy to get them by being nice, but maybe the attempt is enough.

Brooklyn Nine-Nine airs Thursdays at 9 pm Eastern on NBC. Previous seasons are on Hulu.