Reorganized annotation logic.