refactor:extract function
for strcmp
parse json and store it in a struct variable