More changes

Avoiding specifying the native template engine. Avoiding using
$element.empty()