Moved filter to query