further template improvements