Refactors Mailer module.