Refactored view context
Fixed index