refactor; mutex access to peer.conn