Optimise script and pass 'script'