Since you're already using 1.9, you can take full advantage of decomposition of AST::Nodes, like in here: https://github.com/whitequark/parser/blob/master/lib/parser/ast/processor.rb#L121 There are a few other places I see this antipattern (manually unpacking stuff via #children and so on)