cleaning <ref> tags