Refactoring: doing something cleaner for SendMail code