Generalizing cleanup