improve model generator