Remove duplicated and useless entries