refactoring graphs