move Index_translator to be a local class where its is used