small improvements in templates