Changed the whole file architecture of annotationviewer in a clever and smart way