remove unused entities