diagram cleanup