Reorganized the structure of flatree