ClientAuthenticator update: tests and refactoring;