attempt to handle both old and new APIs