refactor Demodulator