trying to refactor the document cloud viewer;