Separated socket work into SocketManager class