Email refactoring