removes unneeded directories