refactor json library