Miguel/plugin refactor

A little odd to use LoDash `filter` but not LoDash `map`; perhaps we should change it, although it does seem worse for readability. We could try using LoDash's [`_.chain`](https://lodash.com/docs#chain)/[`_` wrapping](https://lodash.com/docs#_), though.