move implementation from sequence to index_of