Add hack to optimise memory consumption