Code refactoring for JsonContextProvider