Minor tweaks and optimisations