Moved peer parsing to methods

Parsing the peer list into ports and IPs was moved to two new methods.