refactored some of the graph loading