Refactored ping test