Refactoring printIndex

First added Tests