Refactoring SchemaGenerator to Factory classes