Refactor `isTaskTimeout` out