Refactor JSON utilities module