Refactored filtering logic and moved to a new class ObjectsFilter
Added some exception handling for bad filters