optimizes json