document refining