Moved scripts function