html gen refactoring