cleanup & added osx support in auth process