rename 'todict' to 'to_dict'