Undo template refactoring

As this is orthoganol to HTML rendering change.