better handling of patternProperties