pong: refactored signal handler