Mailer: Make code a bit more modular.