Refactor constraints