Handle template upgrades