Remove res that are not needed.