Refactored the initiation of peers.