Change the logic flow

The listeners variable is a Collection with types, each type has a collection with priorities, and each priority has a collection with handlers