Rearranging templates