Refactored authentication

Refactored authentication to separete class.