[DF-4762] Optimizing BiDi transformations.