more abstract ping function for different use cases