Move entity creation to models.