document refactor