minLabel refactoring