refactor subschema resolution