reduce call of cjson.encode