removes unneeded resources