move axis-aligned bounding box calc to a utility function