Refactor ConstraintManager