Use a main file to run the dispatcher
Use a predicate function to filter the queue
Simplify the way to define predicates