Replace lists with dictionaries