rearrange and add some templates