Refactor annotation graph filter.