better dict_id management