replace some deprecated code