osx: few optimizations