remove un-needed loops.