Move jquery out of templates