refactoring ping, pragmas added and warnings supression added