ping hosts function refactor