Authentication Service refactor and unit tests
more unit tests