Refactored JAAS client.