Remove unused entities