remove wdt code duplication