re-structure templates