Perfomance improvements on bounding box for entity