Refine document