Auth work
Refactoring