Is there any point in trying to look at The HangoverPart III as anything but a petulant piece of filth? Of course the answer is no, but in a franchise built on uncompromising filth, that isn’t necessarily all bad. Make no mistake, though: this is a very bad movie. The story abandons the “What did we do last night?!” set up of the first two installments, and apparently can’t survive without it.

There are scenes of abduction and violence conducted with small crowds of people looking on in the background of the shots. Several characters are shot and killed and the every men at the center of the story are hardly affected. And yet, there is a kind of demented charm to this final installment as we get a sense that director Todd Phillips is almost daring us to try and make sense of a series built on sacrificing coherence for gross-out. With the aid of his three main stars, Bradley Cooper, Ed Helms and Zach Galifianakis, and a slew of others, he has created a movie that exists as a series of gags barely connected by anything other than familiar faces.

The Hangover Part III begins with its two most eccentric characters. Mr. Chow (Ken Jeong) escapes prison in Bangkok amid a slow motion riot, and Alan (Galifianakis) kills his new pet giraffe after drunk driving under a low hanging underpass. After the death of his father (Jeffrey Tambor), his mother and friends (Cooper and Helms among them) stage an intervention to try and get him help.

As they drive him to rehab (along with the always ill-fated Justin Bartha character Doug), they are ambushed by a slew of criminals led by a man named Marshall (a wasted John Goodman). He holds Doug as hostage and tells them to track down and bring back Chow, who stole $21 million worth of gold bars from him. Alan has an email from him saying he’s in Tijuana, they go after him, hilarity is supposed to ensue and sometimes it does.

Galifianakis again brings his terrific comedic underplaying to Alan, and has always been the only real reason to watch any of these movies. Cooper and Helms are effective enough at pretending to be outraged and/or baffled by everything that happens, but they have nothing interesting to do. Leong is finally given enough screen time to do more than make Chow an ugly stereotype, but the movie still treats him as an exotic other.

Their pursuit of him eventually leads them back to Vegas, the unholy cesspool that caused them so much chaos in the first movie. It’s there that Alan finally meets his comic equal in the form of Cassie (Melissa McCarthy), a pawn shop owner that Chow sold a gold bar to. McCarthy is given precious little screen time, but her few scenes with Galifianakis are by far the best in the movie. The two talented comedians elevate the material through sheer force of will.

Measuring Part III against the other two Hangovers, it’s easily better than the abysmal second one and about as good as the first. That isn’t really saying much, as I’ve disliked this series pretty much from the beginning. Phillips is a talented director who, like Michael Bay, uses his gifts to tell repugnant, disturbingly patriarchal stories. This is his Transformers trilogy.