Refactored the graph data to a aggregator, included unit test