Remove use of deprecated APIs