[SDAG] Refactor the code which deletes nodes in the DAG combiner to do