Sockets refactor.