Made use of CAnnotation::castObject to simplify code.