Clean up JSON handling