refined compatibility between osx and linux