Cleaning up graph generator code