Remove usage of deprecated function