Remove unnecessary element from array.