refactor magic matchers