removing redundant directories