Refactor to use #next_node_if
Fix whitespace
Refactor to use #next_node_if