Modified the calibration code to be class-based.