Finally made the ClientFactory work