start to refactor calibration