remove unnecessary entities