OSC stuff + minor refactoring