Extract common code to startExternalProcess