replacing deprecated methods with proper ones