Refactoring. Basic index support.