Improved data-directory selection