Move p2p related code to P2pLinkManager