child_process refactoring