Optimization: move scripts out of body.