refactor deprecated method call.