Refactor to use #next_node_if