some munging
templates