Refine diagrams