Change from using `filter_by` to `filter` for queries