Remove usage of deprecated API