Replace deprecated code.