refine waveform overlay position and remove unnecessary code