Simplifying the code of `AnnotationManager::applyConstraints`