Removed code duplication in JsonPlugin.