make dir management smarter