tree-traversal moved to util