Json code cleanup