refactoring constraints service