Substituting self-made parsing with json library