use native trim & json functions