WARNING: This article contains major spoilers for Season 5 of Supergirl.

The recent episode of Supergirl, "Reality Bytes," centered on Dreamer -- the ancestor of future Legion of Super-Heroes member Dream Girl -- as she took on a transphobic villain who sought to drive her out of her fledgling superhero career due to her transgender status. It was a timely tale and natural progression for Nia Nal, Dreamer's alter ego portrayed by transgender actor Nicole Maines. However, there is the feeling that the delicate subject matter of this storyline may be a bit overdue for the Arrowverse series as it nears the end of its fifth season.

Nia was introduced at the start of Season 4 as a political speechwriter from Washington, D.C. who came to work as an investigative journalist at CatCo in National City. Created specifically for the series, Nia revealed her transgender status to CatCo editor-in-chief James Olsen while discussing her concerns over the growing wave of national xenophobia targeting extraterrestrials living on Earth. Nia was later revealed to be half-alien. Her mother was from the faraway planet of Naltor, and passed on the precognitive and telepathic powers that came from her race to Nia.

RELATED: Supergirl Reveals How Jeremiah Danvers Died

Knowing the importance of Nia's lineage into the 31st century, Brainiac-5 helped Nia develop her superhero persona as Dreamer while entering a romantic relationship with her. Dreamer was integral to the team's battle against the bigoted individuals sweeping across National City, rallying behind Agent Liberty. This culminated in Lex Luthor's plot to turn the general public against Supergirl by using her clone Red Daughter. Season 4 ended with Supergirl's name cleared of wrongdoing, anti-alien movements dispersing and Dreamer becoming a beloved superhero in her own right.

Dreamer wasn't embraced by all, unfortunately. In "Reality Bytes," a man harassed Dreamer's transgender roommate, Yvette, to attract the superhero's attention. Catfishing and isolating Yvette before attacking her, the stranger is eventually tracked down by Dreamer, who uses her civilian alter ego as Nia to lure the villain into a trap of her own devising. And while Kara had originally agreed to let Dreamer take point on her mission to bring down the man targeting her community, Supergirl ultimately has to talk Dreamer down from crossing the line and employing lethal force.

It's perfectly understandable that Supergirl wanted to take its time establishing Nia and her superhero persona before embarking on a transphobic episode. Characters should be developed beyond their respectively diverse backgrounds, otherwise they can come off as derivative, paper-thin caricatures of what they are meant to represent. Nia didn't introduce herself as transgender immediately, nor did she become a superhero until the second half of the show's fourth season. However, since the previous season's xenophobia storyline was resolved and Nia is now a well-established character, Dreamer's transphobic episode could have happened far earlier in Season 5.

RELATED: Supergirl Season 5 Episode 16 References Christopher Reeve Superman Movies

Supergirl's fifth season, however, has largely struggled to find narrative direction. A lot of the first half was hamstrung by the lead-up to "Crisis on Infinite Earths," while the second half has dealt with the reality-shaking fallout of the crossover, which brought Lex Luthor back into the land of the living. A Dreamer episode earlier in the season would have been a welcome interlude amidst all the villains vying for the show's spotlight. After all, as ominous as Supergirl has made the shadowy Leviathan sound, it hasn't really played that prominent a role in the season's narrative.

Transphobia is not a topic to be rushed or handled lightly, by any means. Yet, as Season 5 moves toward its endgame, one cannot help but feel the episode would have been better positioned if it had taken place sooner instead of running the risk of getting lost in the narrative shuffle that has plagued much of the season.

Perhaps when Nia took on the role of Dreamer near the halfway mark of Season 4, that season's themes of xenophobia and fear-mongering would have better tied into the idea of Nia taking on her own transphobic villain. It would've made for one major early test for Dreamer as she got into the superhero game, while giving Season 5 a little more room to breathe and find its own pacing and direction.

Regardless, it is important and noteworthy that the show devoted an episode to Dreamer and the challenges the transgender community faces, even if it was in the middle of an awkwardly executed season. Stories like this are worth telling no matter when they fall within the overarching narrative. And while Supergirl did have to remind Dreamer of the moral line that comes with being a hero, Nia Nal has finally gotten her chance to shine as Season 5 moves to its final confrontation with its growing number of villains.

Airing Sundays at 9 p.m. ET/PT on The CW, Supergirl stars Melissa Benoist as Kara Danvers, David Harewood as Martian Manhunter and Chyler Leigh as Alex Danvers.

NEXT: Supergirl Star Calls Production Halt 'Stressful'