I've extracted all scripts in index.html to a separate file - main.js