started writing tests for matchers and refactor a bit