Rewrite generalized foldr section a bit