Comment Connected function in peer.

While here, also rearrange the functions slightly to logically group them.