Add functions to query for what kind of template is being executed
Rearrange some fields