Upgrade to new directory API