refactor all documents