processor.updateAnnotations function refactoring