refactored
sending email