update sockets + some cleanup