use the constraint class instead of an icky lambda