Refactor Auth