Updated applyTemplate and HTMLSupport