improve directory mapping