Replace deprecated method calls