refactor matcher