[wip] refactoring graph_utils