Replaced deprecated method.