Edit model generator and addition some magic method