Refactor mailer out of authenticator