Make constraint more generic 'grid-based' constraints