Refactor HTML; add HTMLDelegate