Massive refactoring of filter and notification handling