refactor graph-data to make it easier to use externally