More refactoring to make more generic utility class and annotation filter