remove redundant directories