Simplify some code in InvocationMatcher class