rearrangement of templates