more natural directory detection