Refactor the code that checks that all operands of a node are UNDEFs.