Remove unnecessary global variables

The variable `runner` causes the global scope pollution. This change makes it script-local and fixes the global pollution.