Refactors rendering of view to read from index.html