template improvements