random email cleanup

Just refactoring – see commit messages.