Replace deprecated method with supported ones