cleans up duplicate stuffs for xml parsing