Remove use of deprecated function