Refactor FilterTasks