Simplify JsonSerializer code