refactor with customized distributed double barrier based on curator.