refactor template variable tags