Fixed calibration related bugs and converted it over to using class type parameters in factory