Improved optimiser.