Refactor auth
Refactor auth