Cleanup for the simpler Foldable rank code