Update with better optimisation.