replace tuples with dicts