refactoring for the new octree