refactor to daemonprocess class