When Seth MacFarlane was brainstorming ideas for the second season of “Ted,” Bill Clinton came to mind. MacFarlane explains, “The show takes place in the ’90s, and we’re always looking for things that are quintessentially emblematic of that decade. Of course, one of those things is Bill Clinton.”

The Peacock series follows the ongoing adventures of the pot-smoking, foul-mouthed teddy bear Ted. In one episode, MacFarlane stages a masterful spoof of the former president, who appears in Episode 5, “The Sword and the Stoned.” In the scene, Clinton visits Matty Bennett (Scott Grimes), who works at the local Dunkin’ Donuts. When Matty criticizes Clinton for how badly he’s running the country, Clinton retaliates by throwing coffee at him.

It’s a hilarious moment, and MacFarlane nailed the voice.

However, when it came to the visual effects, the production team ran into one roadblock after another. MacFarlane knew the audience wasn’t expecting an exact resemblance but still wanted to get as close as possible. Speaking with Variety, MacFarlane said, “We wanted to see if there was a way to make Clinton look exactly like Bill Clinton, and not like somebody playing Bill Clinton.” Prosthetics didn’t work, and “CGI ended up looking terrifying and distracting.”