Extract instance-pinging logic into its own class

[#67166568]