Factor out single peer operations into separate functions.