Abstracted more puts/printf functions and added an if/else in print_key_and_value