Removes unneeded dependencies.