made constraint more efficient