optimize annotate method