For bytes and time values we typically use byteSizeField and timeValueField methods that support [human](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/common-options.html#_human_readable_output) flag. You can also optimize the code by using XContentBuilderString instead of string constants. [MergeStats](https://github.com/elasticsearch/elasticsearch/blob/master/src/main/java/org/elasticsearch/index/merge/MergeStats.java#L136) is a good example.