Improve the performance of part d