cleanup: return index from file