refactor mailer templates