Move indexes to key/value pairs. Remove duplication.