Refactoring QueryFilter, adding $fields option