refactored ensure_match -> validate