Cleaned up the json data code to store it in variables