Finalize work on memory optimisation