refactor documents