refactory client factory