Added "ping now" functionality; some refactoring