Ugly but hopefully generic cookie for tree utility.