refactor operation graph