Moved code to run on startup from js to html files