Refactoring the ProcessSpawner