TreeIndex implemented with dynamic allocation design, which caused a lot of problems.