Added model creation to factory