refining code

index file code refined and polished