extracted code out of index.html