Simplified some code in calibration utils