refactoring check_user_email, adding test stubs