Refactor html template