TextMatcher refactoring

Code de-duplication