refactored bulk operations encode and added encodeBulkOperation(s)