How to optimize replica exchange when there are orthogonal barriers?