refactor(socket) incapsulate