Add Flatten directory feature