Cleaned up JSON parsing and logging