QuadTree refactored