WIP: Graph refactoring