Added html aware templating capability