cgraph code cleanup