Optimisation: fold parents before childs in foldAll to remove the views first