Add some helpers for tree manipulation