- optimisations and sharing added