refactored ClientFactory. Method is now createClient