Refactoring how to get the auth token