refactored PatternMatcher to provide better api
test stage 1