HTML refactoring