Refactored add_index!