quantization/transform refactoring