Removing unused entities.