quadtree refactoring