Refactor mailer
Refactor mailer