Refine the document