aouth library refactoring