refactor remote peer