My main script is generic and can "execute" many different types of helper scripts. Not all helper scripts need (or even can) act on the detected bad event. That is why the detection of the bad event needs to happen inside the helper script, rather than the main script. Your solution would not work in my case.