[WIP] Factor filter views.

Lot's of code duplication here.