Performance improvements

Signed-off-by: julia-altenbuchner <julia.altenbuchner.11@ucl.ac.uk>