Remove usage of deprecated APIs