script loading improvements