I'd at least pull out normalize_attachments.