util functions in tree I keep putting everywhere