refactored client connections