port to non-deprecated API as told in comments

Authored by cullmann on Oct 8 2019, 6:54 PM.