refactoring indexhtml