refactored indexers and tested