Adapt to new callback API