refactor email validation controller for clarity