Moved Oscillator code to it's own class