Replaced string json building with abstraction