Refactor html5