Change constraint from list to dict for more precise handling.