Graph refactor