Update to the new script API