Trying to optimise for mem leaks