refactored index