oauth refactory