Refactoring  mailer