Refactored client creation