Refactor Barrier API for robustness, deprecate old API