properly remove unneeded packages