Added small utils function to handle json