o: refactoring, used map for converting batchtype to string an vice-versa