Clean up calibration code