refactor ClientFactory