Streamline bounding box handling and test it