helpers filter_and_order_state_as_hash(grid) and filter_state_as_hash(grid)