rename peer to endpoint