improve sequential foldBy