replace '%s' with %q
move template-related functionality to templates.go