extracting to hasConstraint method