More refactoring in smtpclient