refactoring constraints service and version entity