Adapt to the new API design