Switch internal code to use new api