Refine diagram