Finished moving inline script to templates.