Optimization of the model and data export to Excel