moved switch ping process to oop style