add json reading feature; optimization