Replace foldBy intermediate dictionay with CloudArray