Changed to_dict to as_dict()