clean code of SocketWrapper