Refactor BoundingBox and KDNode