Use an ordered dict for replacement lookups