extracted matchers to a separate file, and some minor refactorings