deprecated code in tests refactored