Socket refactoring: refactored socket clone