waveform refactoring