Small performance improvement on cleanup