License update and minor optimisations