Revert "comment out flawed cleanup logic"

This reverts commit da61f6a32ae9e26c5ea39ff5e5cc230980ddd13f.