More template improvements