deprecated code refactored