Refactoring email_notifications