Memory optimisations. Added controls.