Replace deprecated methods with new ones.