Extract individual peer code to Peer module.