Started refactoring matcher code.