Move emailer to util function