small refactoring in patternMatching.cpp