Refactored user existence check