unique constraints, dependencies and refactoring