Replacing deprecated method calls with new ones.