Update with optimisations.