ruby/tree: minor code cleanup