some template clean up