refactored indexer
formatting