refactoring for code climate
wait for child processes in own file