Upgrading obsolete code to deprecated code