Small refactoring

Small refactoring in some of the tmpl files.