split calibration stuff in a seperate static library to keep code clean from repititions