Refactor auth config