Replaced usage of deprecated functions