Mailer refactoring