move scripts to external js