Removing useless resources