Refactor operation parameters handling and add test for query with batch size.