Refactoring SMTP