Add better tree support