Graph.h refactoring