Create tree datastructure.