Optimised script