index refactored