Refactoring of P2PSyncManager.