rhosimulator/osx: code optimization