fix for a bug in template (copy-paste error) + some cosmetic changes