refactored Emailer file