optimization and refactor to ignore watchdog events