Refactor reveal_to_target
and next_store_index
#1261
Merged
reveal_to_target
and next_store_index
#1261