constraint refactoring