Refactored "script"