updated protocol and moved sockets remove logic line to Connection class