refactored deprecated function call