some refactoring in compressor