daemon stop refactored