Refactor watchdog-related