remove ugly javascript in template