refactored html5 code