email confirmation refactoring