Change the name of Generator#to_c to #to_char and brush up some codes