refine document