Refactor filtering to jedi-direx:-filter-cache function