Update auth, refactoring