task filter refactor