optimizing the performance