Added mailer & minor refactor