all needed functions using to_hash and to_dict