Refactoring Auth classes
Fixed some bugs