Refactor for oscillation