Refactored ping to be prototype based