A annotation generation logic