Replace deprecated method