refactored email validator