Adapt grid scripts