redesign and refactoring of the graph