Refactored to use SchemaFactoryWrapper