little auth related refactoring