improve readability of template replacement (??)