Refactors generate_data_to_print_a_month method.