Better use of MkdirAll at actual points where it is needed.