html code refactoring