Refactoring of the helper function for decorator and annotation in their own module. Made annotation retrieval more generic