refactor and update document