Refactor bearerAuth