Refactoring 'keepRunning' boolean to use a DU.