Refactor annotation parser