Improve optimize.