Refactor AbstractPeer. Close #2