better constraint generator