generalising identifier mapper to handle all types of annotations