Optimization of the first part