Refactor matching constraints