Added changes to use the new API