Simplified logic to call node.remove