refactored annotation creation codebase