Refactor templates
Refactor mailer helper