Graph utils code cleanup

Optional code cleanup.