Improved generation of model