Moved data-getting functionality out of index view.
Fixed name conflicts.