remove useless resources.