no need to extract dirname from the same path string every iteration
2.0.2