Adapt to the new API