email validator refactoring