Refactor ParameterizedPatternParser to have a slightly nicer API