EmailReader refactoring and test.