Jira CC-569 (dupl. key check)
clean bad index maintenance code