Refactor to simplify graph transition part 10