Finished up refactoring to make the new batch api be backward compatible with pre 2.6 servers