refactoring on html5