Refactor mailers and email processing