Refactor to isBasicAuth and isTokenAuth