Moving html to js template