Adapt to new API