continue daemon main() refactoring