Updating code to remove deprecated functions.