MID-1954 - delete all identites function redesigned.