refactor annotate for ~10% speedup.