[enh] better signal handling in deamons and deamon code refactoring