Refactor the model towards more generalized filtering, in support of

#1