adapt to different API