refactored method that checks if a user is registered