partially revert: daemon: refactor and cleanup