Added index.html and refactor the code to work with it