Refactored calibration a bit