Refactor OAuth operations