start/stop daemon refactoring