replace deprecated method calls with their replacement