Moves around js in templates