improve setPeer and listPeers