oscillator refactoring