fully refactored authentication to include it in its own module!