Improved place of adding constraints.