optimize the load code to support osx format.