CFY-644 some refactoring in task graph