refactor Auth class.