Adding schema creation to factory