Refactoring (listener -> filter)