Generifying tree structure.