Refactor the email sender