Change platform detection method and expose it in library