Remove unneeded substring