flattening dir structure