Hmm. I see your point. 

The thing is that I'll get the 'remove' message for preview layers too (preview layers might come from catalogtree, but can also come from search or wmsimport, etc). I need to ignore those. The same is true for backgroundlayers (when backgroundlayer is switched).

I think this filter will be used in other locations too (for instance, the directive responsible for removing all layers when the topic changes). But this is a decision of principle: is each component responsible for knowing what layers it might manipulate? (even if most of the time all components do in fact manipulate the same layers leading to possible violations of the DRY principle for such filters).

I have no qualms to keep them seperate for now and see how it evolves. If you still agree, please close this PR.