much cleaner way of generating the index.html page