Simplify the code for adding annotations.