Optimizing Cardiac Device Upgrades and Downgrades