Added isValid checks and optimized performance by returning directly if no interesting PsiElement is passed into the annotate method