Minor refactoring of Script.py