more oauth refactoring