Refactoring of octree