refactor and add both to graph