Move OSX-only function to correct place