Refactored DiagramEditor