Move JS outside index.html