Refactor Mailer to namespace