Simplify dangling metadata cleanup