Auth refactoring.