cleaned up messy code snippets - pre:refactor of graph create method