Updated to use the new API