Pulled out the template role to make things less ugly. This will not be parsed and is fit for cutting and pasting.
More roles and some cleanup.