Refactored matcher