Factor out File::Temp->new->dirname call