Reworking/refactoring auth feature code
Refactored and moved code a bit