refactorings of the graph module