Refactored sockets test work