bunch of work on secondary indexes