Slight refactoring for authenticated request setup