Different standalone functions to work with trees and tuples, not reqiuired to be a member of any class.