Added a hook concept to allow multiple executions of the same script