From the moment he first appeared on Showtime’s pot-centric comedy, Weeds, Andy Botwin (Justin Kirk) has loudly and proudly flaunted his Judaism. After arriving four episodes into the series as the brother of Judah, the recently deceased husband of shiksa-turned-pot-dealing mom Nancy (Mary-Louise Parker), Andy demanded to be the center of attention, letting his sexual impulses guide him from one disaster to the next.

While the show may be best known for breaking ground in the female-anti-hero genre, (Mary-Louise Parker’s drug dealer preceded Nurse Jackie and Damages,) in recent years, it has taken some odd geographical- and plot-based twists, which the new main-title sequence humorously depicts. And while the somewhat mixed series comes to a close this Sunday after eight seasons, throughout it all, it’s been hard not to love moocher Andy, the promiscuous playboy who keeps finding his way back to his Jewish roots.

What’s most wonderfully—and unexpectedly—refreshing about Andy is his very real relationship with Judaism. Even if a segment of the companion Web series University of Andy features a common TV concept—Christmukkah—most of Andy’s Jewish experiences are far less Seth Cohen than that. When Andy enrolled in rabbinical school during the show’s second season—to escape being called up for reserve duty and sent to Iraq, of course—he was seen listening to recorded prayers and participating in communal Israeli dancing.

But in this final season, a chance meeting with a rabbi at a hospital has enabled him to get his most stable job yet, as director of spiritual life in the synagogue’s Hebrew school. Though Andy may spend most of his life acting like an irresponsible clown, he’s capable of getting serious and teaching the next generation surprisingly accurate and detailed intricacies of the Jewish faith: It’s rare to find a TV character capable of captivating pre-pubescent boys equally with a rather graphic masturbation lesson and a lecture on why the Torah is not meant to be interpreted literally.

But even Andy’s biggest fan has to acknowledge that he most frequently invokes his Judaism as a get out of jail free card. Shirking military service by entering rabbinical school was hardly a great start, and Andy’s motivations for becoming an active Jew are never pure. Even his latest job resulted from an unplanned pregnancy out of wedlock. Yet on a show filled with liars and criminals—a pot dealer, a drug cartel, and a handful of other unscrupulous, corruption-prone people—Andy is the most endearing character. Though he spent most of his stint in rabbinical school trying to sleep with admissions director Yael Hoffman (Israeli actress Meital Dohan), he came away with a renewed sense of pride and peoplehood that shows in his new academic capacity.

That’s not to suggest that Andy’s charm can get him out of every situation. He doesn’t always see things through, and he is distracted by the presence of either women or pot. He tends to get caught up in his schemes and overly attached to temporary situations, in which he and his drug-dealing family often find themselves. Yet through it all, he’s genuine: The lies he tells and the stories he makes up don’t last because his conscience gets the best of him. As he eyes and beds new women, he expresses his affection and takes a deep interest in each and every one of them. His actions may not be explicitly guided by Jewish values, but, time after time, he keeps coming back to a Jewish way of life.

Andy doesn’t purport to be the most knowledgeable Jew out there: He is the ultimate example of imperfection, and it’s hard not to root for—or relate to—someone who has good intentions and isn’t always able to live up to them. As the show nears its end, he has been looking back at his life and his decisions, demonstrating exceptional growth after eight years of marijuana, women, and bad choices. Ultimately, for Andy the ends do justify the means, and the way he got somewhere is less important than what he’s achieved, building a truly unique legacy for himself as TV’s most knowledgeable Jewish slacker.