Implemented iris-and-labels-must-be-unique and some refactoring