refactored email validation code in profile#update action