restructure templates