matcher refactor