Refactoring and PEP8
Remove the sub-execution context when the sub-process is finished