Optimizing deletion of objects