Added refactoring replaceTypeCodeWithStateOrStrategry