Refactoring child process handling to use SIGTERM.