Changed factory to update graph data so that is more generalized.