Remove unneeded substring.