Refactor Sort and filter by labels to filter by annotations.