Refactor HTML/XHTML init targets #1523
Reduce HTML/XHTML code duplication #1523