Refactor allows for re-use of OSC handling function