refactored templates out of inline script tags in index.html to seperate template files