Unified version for both OSX and iOS