Further template improvements