Refactoring: Extract method on indices