Now that HBO’s tech-startup comedy Silicon Valley just finished its second season and has been renewed for a third, its star Thomas Middleditch jokes that he’d like to see his entrepreneur character go through a big transformation sometime soon. “Skip ahead, and it’s almost like a Breaking Bad story,” says the actor with a laugh. “He goes by the name of Heisenberg.” It’s no wonder Middleditch craves some kind of antiheroic arc for the timid Richard Hendricks, considering show creators Mike Judge, John Altschuler and Dave Krinsky wrote the role with Middleditch in mind. Although his character probably won’t end up in a shootout with meth dealers anytime soon, the actor says he has enjoyed watching Richard become more comfortable with being a CEO this season. Middleditch recently spoke with AwardsLine about how he implements his improv background on the series and working with some of his closest friends.

Did the technical language of Silicon Valley take any getting used to for you? And did you do anything specifically to prepare to play Richard?

I’m into computers, and have been for a while. I would never call myself a programmer, like what Richard does, and what all of Silicon Valley does is 10 levels above what I can generally comprehend. But I know the world to some degree. So I didn’t do too much preparation other than what’s this person like on an emotional, qualitative level. For the jargon and the language, we actually have a consultant on set who makes sure we say things (correctly). I mean, there are times when it feels like a medical procedural drama.

Has it been fun to see your character evolve into a leadership role this season?

Richard is in a position in the show where the pressure of the company is all on his shoulders. Everybody gets to have fun, and when you come to Richard, he’s rubbing his temple like, “What am I going to do?” I’m usually the character guy, the weirdo guy, so it’s been fun to take on some of that weight. Both myself and the showrunners have always looked for opportunities for comedy, just so he’s not the story guy and every time you need a story, you go to this guy because then that kind of castrates some of the fun of a lead in a show. One of my favorite episodes was where he fights back a little, and you want to pat him on the back and say, “Right on, man. Way to find those balls of yours.”

Mike Judge has talked previously about how Richard’s character has the most of his own experience incorporated into it. Did he give you any insight into that?

Mike used to get panic attacks, and that’s where that whole element of Richard stems from. He was telling me, “This is what it’s like to have a panic attack. Trust me. I wrote it because I used to get them,” and I was like, “OK.”

Silicon Valley reunites Middleditch with his friend from his improv days, T.J. Miller, above left. “We’ve done an improv show for one person,” Middleditch says of their hardscrabble days. “We did this for like a year and a half, just trying to get folks to come see our comedy.”

You and a lot of your castmates have improv backgrounds. Is there any improvisation on set?

It’s not one of those shows where the script is just a jumping-off point, just because it’s so precise and narrative-based and jargon-based. The inmate joining the asylum on that might not be a good idea. We also are pretty fortunate. We get really good, intricately woven scripts. So it’s more about finding little moments for character color, a little exchange, a joke here or there. We’ll mess around sometime in rehearsal because we’ll do a couple of passes before we end up shooting and that’s our quote-unquote rehearsal. We’ll also try stuff when we’re shooting, and then plenty of times someone will come up to us and be like, “Hey, let’s not do that. Let’s stick to the script, and let’s try it one more time.” I’m happy that they’re pretty diligent about it. I’m definitely not frowning on improv, I mean, I’ve been doing it for years. I just think that there’s some styles of comedy that warrant a tighter pace. Sometimes you just need words on a page to memorize.

You’re also working with some of your really good friends. Has that made the experience of being the lead on an HBO series that much better?

Friends or no friends, I’d still be really excited to be on this show. It’s a huge cherry on a pretty awesome cake. I’m not joking—it’s a top-three dream of mine to be on a comedy on HBO and to have it directed by Mike Judge and Alec Berg, and then on top of that, have it be with friends, two of them I’ve known for 10 years. The craziest part is T.J. (Miller, who plays venture-capitalist Erlich) and I used to do these improv shows in Chicago, and we would have to cancel because no one would come. We’ve done an improv show for one person. We did this for like a year and a half, just trying to get folks to come see our comedy. Skip 10 years, and we get to be on this show. I don’t know—I don’t want to sound too cheesy, but it’s just pretty cool.